Back to Browse

How I solved LeetCode 49. Group Anagrams in JavaScript

174 views
Sep 26, 2023
6:55

Hey! My name is Tomas. Thanks for checking out my channel. Problem LeetCode 49. Group Anagrams https://leetcode.com/problems/group-anagrams/description/ GitHub Solution Solution: https://github.com/R-Tomas-Gonzalez/github/tree/main/0049-group-anagrams 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 https://youtu.be/c0utOWQCOl0 strs[i].split('').sort().join(''); - Process Create a map Loop through the array Return object.values Resources https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values • Connect with me on LinkedIn: https://www.linkedin.com/in/rtomasgonzalez/ • Connect with me on GitHub: R-Tomas-Gonzalez (Tomas Gonzalez) Happy Coding!

Download

0 formats

No download links available.

How I solved LeetCode 49. Group Anagrams in JavaScript | NatokHD