String Permutation in JS

February 28, 2020

So in a bid to beef up my technical interview preparation, I've started on some simple coding questions. Below is my attempt at identifying if two words (or strings) are permutations of each other (meaning they both contain the same letters in the same amount).

One is a O(nlogn) implementation, the other is an O(n) implementation.

(I'm also using this to test out embeds from vs Codepen - here, I've used glitch, as I prefer to show only the code. But maybe in this case I should use Github Gists instead?? Hmmm)