Not able to make logic for this ... how to proceed?

Not able to make logic for this … how to proceed ?

@Kirtee2002
according to the problem, you need to check if its possible to split the array in two parts such that first part is purely decreasing or you can say in descending order (no two elements should be same) and second part is in increasing order ( no two elements should be same).

The Approach :

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, than 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, than break.

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

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :slight_smile: