<algo> hackerrank solutions to cut_the_tree and gem_stones challenges