Hacker Rank Solutions in Python