Skip to content

Instantly share code, notes, and snippets.

@jianminchen
Created February 12, 2018 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jianminchen/ba11e8cd68e9d3b7de3fb552dc67f933 to your computer and use it in GitHub Desktop.
Save jianminchen/ba11e8cd68e9d3b7de3fb552dc67f933 to your computer and use it in GitHub Desktop.
Group anagrams - mock interviewing - The peer came out the rating of 4
interviewing.io
['abac', 'baca']- sort each character then use a map
n * mlog(m) - based on the fact that word is short, mlogm is still efficient
['aaaaaa' * 1000, 'aaabbbb'* 1000] -> iterate through each word then count number of characters
n * m
counting sorting
26 -> a 0
+
a+"i"
n1 +"+"+n2+...+ ""
anagram
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment