group_anagrams.rb
Ruby 4.0
Not run yet
+ 7 hidden
Input
strs = ["race", "care", "arc", "acre", "car", "cat"]
Expected
[["race", "care", "acre"], ["arc", "car"], ["cat"]]
race, care and acre use the same four letters, arc and car the same three. cat has no partner, so it is a group of one. Inside each group the words keep their input order.