Solutions to problems on Hacker Rank