#include
using namespace std;
bool sorted(int arr[], int n)
{
if (n == 0 || n == 1)
return true;
if(arr[0] < arr[1] and sorted(arr+1,n-1))
return true;
return false;
}
int main() {
int n ;
int arr[1000000];
cin >> n;
if (n < 1000)
{
for (int i =0 ; i <n ; i++)
{
cin >> arr[i];
}
bool num=sorted(arr,n);
if(num == true)
cout << "true";
else
cout << "false";
}
return 0;
}
Please advise one of the test case is getting failed.