solution for interviewstreet challenges