solutions for hackerrank