the sample input in problem is given
5
1
2
3
4
5
but the sample output is true
shouldn’t it be false because 1,2,3,4,5 is just strictly increasing and its no sub part is in decreasing order
Increasing Decreasing sequence sample
Hello @chahatkumar,
In this case the array can be divided as follows:
1 and 2,3,4,5.
An array containing single element can be considered as either increasing or decreasing.
A decreasing array is defined as an array in which every element is neither bigger nor equal to the previous element and since there is only one element, it doesn’t violate the condition for decreasing, it is decreasing.
Like if you understood.
1 Like
If your doubt has been clarified, please mark it as resolved and do rate me on the basis of your experience(below the option of marking as resolved)