Hacker Rank codes used to solve the problems