Medium Problems49. Group Anagrams49. Group AnagramsLeetcodehttps://leetcode.com/problems/group-anagrams/ Solutions Code 1Code 2function groupAnagrams(strs: string[]): string[][] { const map = {}; for(let i = 0; i < strs.length; i++) { let str = strs[i] let sorted = str.split('').sort().join('') if(map[sorted] === undefined) { map[sorted] = [str] } else { map[sorted].push(str) } } let res = []; for(let key in map) { res.push(map[key]) } return res; }; Video Solution ...good question to practice fundamental Last Update: 11:43 - 16 April 2024ArrayHash TableStringSortingPrevious11. Container With Most WaterNext53. Maximum SubarrayOn this page