Solutions to hackerrank problems