Solution to problem 8
Solution to problem 1 in Ruby