Created
September 22, 2018 07:38
-
-
Save jianminchen/92a7bb21b3e35b4aebf2ee5582491576 to your computer and use it in GitHub Desktop.
Sept. 22, 2018 group anagrams
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given an array of strings, group anagrams together. | |
Input: ["eat", "tea", "tan", "ate", "nat", "bat"], | |
Output: | |
[ | |
["ate","eat","tea"], | |
["nat","tan"], | |
["bat"] | |
] | |
count[26] -> eat -> [0] 1, [4], 1, t 1 -> what generate: a-1 e-1 t-1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment