FileOwners


Ruby Language Public

Easy  

15min

Implement a group_by_owners function that:

  • Accepts a hash containing the file owner name for each file name.
  • Returns a hash containing an array of file names for each owner name, in any order.

For example, for hash {'Input.txt' => 'Randy', 'Code.py' => 'Stan', 'Output.txt' => 'Randy'} the group_by_owners function should return {'Randy' => ['Input.txt', 'Output.txt'], 'Stan' => ['Code.py']}.

Ruby 2.2.2
   

  •   Example case: Wrong answer
  •   Each owner has a single file: Wrong answer
  •   Various files: Wrong answer