Skip to content

Instantly share code, notes, and snippets.

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);