Here is the question : CodeChef: Practical coding for everyone
and this is my solution
CodeChef: Practical coding for everyone
It is working fine for all cases, according to me. Can anyone please help me with the case where this fails!!! Thanks in advance!..