Solution to a Simple Puzzle on InterviewStreet