Group Anagrams | SOLUTION WALKTHROUGH - Hashmap

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • LINK TO PROBLEM: leetcode.com/p...
    yo!!!! this one's a little bit interesting - we're using python tuples as keys to our dictionary/hashmap. along with that, we're using an array of length 26 to denote how many of each character are in a word.
    these are very useful ideas/tricks to remember for other leetcode problems. please let me know if you have any questions!!!

КОМЕНТАРІ • 2

  • @nick_esqueda
    @nick_esqueda  Рік тому

    if you're using java/javascript/whatever language, the alternative to the tuple is to turn the "pattern" array into a string! just make sure you separate each character count with a delimiter, like "#".