Increasing Decreasing sequence

how to tackle this problem

Given an array S of size N , check if it is possible to split sequence into two sequences -
s1 to si and si+1 to sN such that first sequence is strictly decreasing and second is strictly increasing. Print true/false as output.

@sk1
You can use a while loop, and keep on incrementing index until the values are decreasing, if a value comes whose value is greater than equal to value of that previous one, then break from the loop

Make another while loop, and keep on incrementing index until the values are increasing, if a value comes whose value is less than equal to the previous value, then break.

Lastly check if that index has reached to end of the list, if yes than output ‘true’ else output ‘false’.

Hope this resolved your doubt.

I’m not able to pass only one test case. my code link : https://ide.codingblocks.com/s/236019

@sk1 getting equal to at any place will make the whole sequence invalid but you have never considered case for getting equal number,i have updated it for you look here https://ide.codingblocks.com/s/236083