Add Ruby library solution.
Solve using Hash and Array.