Why is this code not working? Please tell

Why is this code not working?
Please tell

http://codeforces.com/problemset/problem/451/B

@cbcao263 just refer cf editorial and upon submitting check which case you are getting wrong for and dry run

Can’t You or anyone else tell, What’s wrong in my code or Algorithm? @Ishitagambhir
@keshavgupta0103

Ok wait will see @cbcao263

@cbcao263
5
69 37 27 4 2
your ans no
correct
yes
1 5

But How 1 and 5 can be missing?
There are so many numbers missing from that.

I am thinking of having one issue that I only did when the series will start from one but series can start from any other number too so that will be an issue for that.
That’s why…

@cbcao263 you just have to tell two indices i and j such that after reversing the array from i to j it become sorted in this case
after reversing from 1 to 5
array becomes 2 4 27 37 69 ie sorted