Increasing Decreasing sequence

what approach is there to solve this question-Increasing Decreasing sequence in challenges-fundamentals

@pragyachoudhary1111 The approach to this problem is very simple. It is that you take 2 iterators let’s say i & j. Initialize i to 1.
Now iterate over the array until the previous element is greater than it. If you find an element which is greater than it’s previous number then break the loop over there.
After that you put j = i+1 and iterate on the loop again from j = i+1 to n till previous element remains smaller that the current. if you find any element NOW which is smaller than previous
then break the loop again

This is the approach in simplest terms you also have to put some conditions for return: after the first loop ends, after second loop ends which I shall not tell you here because it will be the complete solution then.

Please try the question now.
Hope this helps :slight_smile: