hacker rank algos that worked well