checking in Hacker rank puzzles