Solutions to problems on HackerRank. Note: Please give it a thought and try to solve it yourself, before searching for the solution