Solutions of Hackerrank challenges in Ruby