Solutions to InterviewStreet problems in Python