Solve problems 14,17,36,56 using Ruby.