Solve problem 47 using Ruby.
Replace arrays with hashes to improve performance.
Remove useless module inclusion.