Why is the code wrong here?

https://www.codechef.com/viewsolution/37709560

logic:https://www.geeksforgeeks.org/count-the-number-of-non-increasing-subarrays/

line 12-
if (length > 1):
condition is not needed
ur code fails for i/p-
1
3
1 2 1
ur o/p-3
correct-4

1 Like