LeetCode 49. Group Anagrams
Problem: Given an array of strings, group anagrams together. Example: Input: ["eat", "tea", "tan", "ate", "nat", "bat"], Output: [ ["ate","eat","tea"], ["nat","tan"], ["bat"] ] Summary: 1. Create a defaultdict(list) to save the sorted word as a key in list format. 2. For each word, sort the word so that any anagram word would be saved in a list under same key. 3. return with all values saved in ..
2020. 8. 19.