i was getting 2 testcase as error
Is sorted array
@Chandra123 we have to check for cases of equality as well.
For eg, 1 2 2 3 4 5 is also a sorted array, but as you are strictly checking for greater than cases your code will give false in this code, whereas, the correct answer is true.
In line number 6 of your code, change arr[i] < arr[i+1] to arr[i] <= arr[i+1]. Also, in line number 17 you have passed o instead of 0 to the function. Fix these minor bugs and your code will work fine.
Hope this helps.