Hacker Rank solutions