Update data science solution

Why do `.to_i` on the result? There are other ways to directly compute this information. For instance, `Array#group_by` would probably be more direct.