Skip to content
loading...

re: Algorithm 202 (My Interview Question): Grouping Anagrams in 3 Ways VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Great article, and good interview question. Good work, keep it up! :) Just wanted to share my approach to this: function groupAnagrams(anagrams)...
 

Thank you Wojciech. I love your method. It's very clever and coincise. Works perfectly too.

dev-to-uploads.s3.amazonaws.com/i/...

Do you mind explaining what is going on in the reduce() function probably by commenting the code?

 

I thought of reducing array of anagrams to an object which keys will be initial words and values arrays of anagrams from these words.

code of conduct - report abuse