问题描述:
Given an array of strings, group anagrams together.
For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"],
Return:
[
["ate", "eat","tea"],
["nat","tan"],
["bat"]
]
Note:
For the return value, each inner list’s elements must follow the lexicographic order.
All inputs will be in lower-case.
给出一个字符串数组S,按照同构词(相同字母组成的单词)分类,每类单词按照字典排序。
问题求解:
利用hash表。
class Solution {