This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Solution { | |
| public ArrayList<String> anagrams(String[] strs) { | |
| // Start typing your Java solution below | |
| // DO NOT write main() function | |
| if(strs.length < 2) return new ArrayList(); | |
| HashMap<String, ArrayList<String>> map = new HashMap(); | |
| for(String str : strs) { | |
| String key = sortChars(str); |
NewerOlder