Solved InterviewStreet code problem.