Solve problem 91 using Ruby.