Solutions to problems on hackerrank