"""Leetcode 49. Group Anagrams
Medium

URL: https://leetcode.com/problems/group-anagrams/

Given an array of strings, group anagrams together.

Example:
Input: ["eat", "tea", "tan", "ate", "nat", "bat"],
Output:
[
  ["ate","eat","tea"],
  ["nat","tan"],
  ["bat"]
]

Note:
- All inputs will be in lowercase.
- The order of your output does not matter.
"""

class Solution(object):
    def groupAnagrams(self, strs):
        """
        :type strs: List[str]
        :rtype: List[List[str]]
        """
        pass


def main():
	pass


if __name__ == '__main__':
	main()

@@ -487,52 +487,691 @@
 r%5D%5D%0A
-        %22%22%22%0A        pass%0A%0A%0Adef main():%0A%09pass
+%0A        Output Limit Exceede.%0A%0A        Time complexity: O(n*klogk), where%0A          - n is the length of strs,%0A          - k is the lenght of the longest string.%0A        Space complexity: O(n).%0A        %22%22%22%0A        # Store in a dict with sorted string as key and string array as value.  %0A        anagrams_d = %7B%7D%0A%0A        for s in strs:%0A            # Get sorted string as key.%0A            k = ''.join(sorted(s))%0A            if anagrams_d.get(k):%0A                anagrams_d%5Bk%5D.append(s)%0A            else:%0A                anagrams_d%5Bk%5D = %5Bs%5D%0A%0A        return anagrams_d.values()%0A%0A%0Adef main():%0A    strs = %5B%22eat%22, %22tea%22, %22tan%22, %22ate%22, %22nat%22, %22bat%22%5D%0A    print Solution().groupAnagrams(strs)
 %0A%0A%0Ai
@@ -1200,9 +1200,12 @@
 _':%0A
-%09
+    
 main

Complete sol by dict