can anyone tell me where is i am wrong
question link is CodeChef: Practical coding for everyone
my submission link is CodeChef: Practical coding for everyone
in my solution for ans=1,2 i take last pole which is different and check before this and after this is both side are not sorted then ans is 2 else ans is 1.