filmov
tv
How I solved LeetCode 49. Group Anagrams in JavaScript

Показать описание
Hey! My name is Tomas. Thanks for checking out my channel.
Problem
LeetCode 49. Group Anagrams
GitHub Solution
Notes
- Edge cases
We can see in example 2 and example 3 that if the strs are null or length of 1, we can return it in an array
- Help from LeetCode 242 Valid Anagram solution
strs[i].split('').sort().join('');
- Process
Create a map
Loop through the array
Resources
• Connect with me on GitHub: R-Tomas-Gonzalez (Tomas Gonzalez)
Happy Coding!
Problem
LeetCode 49. Group Anagrams
GitHub Solution
Notes
- Edge cases
We can see in example 2 and example 3 that if the strs are null or length of 1, we can return it in an array
- Help from LeetCode 242 Valid Anagram solution
strs[i].split('').sort().join('');
- Process
Create a map
Loop through the array
Resources
• Connect with me on GitHub: R-Tomas-Gonzalez (Tomas Gonzalez)
Happy Coding!