The problem is what's the minimum amount of reverse so the array become sorted. I observed in the worst case answer is N-1. But how can I solve the problem?
The problem is what's the minimum amount of reverse so the array become sorted. I observed in the worst case answer is N-1. But how can I solve the problem?
Hi I'm using Ubuntu compiler and I wrote this code 17711437 this code returns wrong answer input 2 and 3.
But in Windows this code gets Accepted. How can it be possible?