Approach not clear

This is how i think i should approach this problem:
//store in array
//divide array into two parts
//each part must have two elements
//reverse the elements in first part
//see condition
//print Yes or No
Please let me know if im thinking correctly and please provide an alternate way to approach problem

Try thinking more simply…
Here is a hint:
traverse the array while keeping a boolean variable storing if minimum has been reached.
Try thinking in these terms and if you still need help, then reply again.

@A17CRX0054 should i traverse array after dividing into two sequence or before dividing into two sequence.?

You dont need to divide the array at all, just keep the track that the array can only have one element whose previous element is bigger than it, and next one is smaller…if this condition is fulfilled…then its fine and for any other situation, the required condition is not met

Hey Ankush,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.