HackerRank solutions in Python