Found this one on stack overflow there is a answer present but i still am not able to understand it.Please if someone can walk me through the solution or explain it step by step.A similar question was in my interview and it has been bugging me.