同分异构词归类

Given an array of strings, group anagrams together.

Example:

Input: ["eat", "tea", "tan", "ate", "nat", "bat"],
Output:
[
  ["ate","eat","tea"],
  ["nat","tan"],
  ["bat"]
]
用一个hash表来存储字典序同分词,后面用一个容器接原词;
例如 ate eat tea ,字典序都是aet,后面的second为一个vector容器,承接 ate eat tea
code will talk

 


posted @ 2019-03-19 15:07  zzas12345  阅读(231)  评论(0)    收藏  举报