Solve problems 7,13 using Ruby.