Doubt in code output

heyy instead of getting true false as output i m getting 0 and 1.

@Aparna Use something like this then:
if(ans)
cout <<“true”
else
cout<<“false”

1 Like

I made the changes but on submitting I m getting one wrong answer

@Aparna Replace line number 9 with if(arr[0]<=arr[1] && issorted(arr+1,n-1)) and then check.