Solutions for hackerrank.com