Did not getting the solution

Please give me hint about this question how to start,

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’.

code for reference purpose:

The solution you provide to me has use of arrays but in the question it is clearly mention that we do not have to use arrays

The solution provided by you give wrong answer

the code provided is correct, an extra snippet appended by mistake, https://ide.codingblocks.com/s/227487

solution that doesnt use arrays or list

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.