Solve problem 66 using Ruby.