Group Anagrams - LeetCode 49 - JavaScript

preview_player
Показать описание


Walk through of the solution to the LeetCode question, Group Anagrams.

Popular interview question at MicroSoft, Amazon and Meta.

LeetCode Question 53

JavaScript

0:00 Intro
0:37 Explanation
2:44 Code

#softwareengineer #leetcode #javascript
Рекомендации по теме
Комментарии
Автор

BHAI, great explanation. My first video on your page and i didn't even have to look at the code once after you explained your process. nice, subscribed

abhisheksaxena
Автор

thank you.. your explanation is easy to understand

GarnettaKola
Автор

Nice solution. While trying to solve this I definitely thought of using a map of arrays and then got bogged down by the details. It's nice how the map does the grouping for you! Is there a more efficient solution you can do without sorting?

sawyerburnett
Автор

You could have skipped the map and thrown the string sorting into the for loop. Also you could have used a Map object.

DeepDuggal-cq
Автор

This is O(n*m*log(m)) time complexity. You could do this in O(m*n) time complexity abusing the fact that the number of lowercase characters is constant. Idk how to do it in JS tho, no good Map equality operator

ljubisaknezevic
Автор

what's the difference between declare the map as normal object, and declare it in
let map = new Map()

osamahussam
Автор

Do you have a github repo where I can refer the solution ?

apex
Автор

TypeError: map[ordered[i]].push is not a function how do I get around this error

vinaykumardevadiga
Автор

Hi, some more console logs along would be helpful.

hofimastah
welcome to shbcf.ru