I' mean "killer techniques" naah, pretty basic stuff, good post for beginners, don't get me wrong. Also there's a better way to get the same result on the Occurrence Counting technique, check this:
const occurrences = ["a", "b", "c", "c", "d", "a", "a", "e", "f", "e", "f", "g", "f", "f", "f"]; const dict = {} occurrences.forEach((letter)=>{ if(dict[letter]){ dict[letter]++ } else { dict[letter] = 1 } })
You make just one loop to get the occurrence counting, I think could be optimized more using maps.
I guess that make sense, some of these are more for beginners.
That does seem like a more efficient way to do it, thanks for the suggestion.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I' mean "killer techniques" naah, pretty basic stuff, good post for beginners, don't get me wrong. Also there's a better way to get the same result on the Occurrence Counting technique, check this:
You make just one loop to get the occurrence counting, I think could be optimized more using maps.
I guess that make sense, some of these are more for beginners.
That does seem like a more efficient way to do it, thanks for the suggestion.