Solutions to hackerrank.com warm-up algorithyms