Solve problems 19,99 using Ruby.
Improve performance of Ruby's problem 39.
Refactor to use enumerable/library methods.