Solutions to Hackerrank problems