注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
Given a set of words in a dictionary, write a program to group all words which are anagrams of each other in to sets.
You can use any C++ STLs or other languages like python if you want to code this..
example:
input:
"bat", "tar", "xyz" , "tab", "tar"
output:
[["bat", tab"], ["tar", rat"],"xyz" ]
(Note: In this example, all words are only of three characters but this is not always
guaranteed. The input may contain words with any number of characters) |