I didn’t understand what we want to do, what are the end conditions asked in this question. Please elaborate with examples.
Please Elaborate the Question
@lckyb27 you have to check whether the array satisfies following property
from start to i it is strictly dec and i+1 to end strict increase like ex
5 4 3 2 1 2 3 4
here i=5 coz from s to 5 strict dec and 6 to 8 strict increase.
i hope its cleared if yes dont forget to hit like and mark resolved 
@vatsal38 I didn’t know what’s wrong in this ?
Can you update it in the above code with some comments?
@lckyb27 from seeing your code i think you want to use prev and curr approach but you have implemented it all wrong so i tried to keep the same variables as your approach here
(btw the one i wanted you to refer was based on your approach only too)