Had a hard time finding the bug in my solution. I thought my algo should work well!
I would really appreciate if someone could point out the test case which would break my code!
http://www.codechef.com/viewsolution/1456568
problem: CodeChef: Practical coding for everyone
thanks
sk