Solutions to hacker rank challenges