public ArrayList<String> anagrams(String[] strs) {
		ArrayList<String> result = new ArrayList<String>();
		if (strs.length <= 1) {
			return result;
		}
		HashMap<String, Integer> maps = new HashMap<String, Integer>();
		for (int i = 0; i < strs.length; i++) {
			// current string
			String temp = strs[i];
			char[] chars = temp.toCharArray();
			Arrays.sort(chars);
			// sort current string
			String s = new String(chars);
			if (!maps.containsKey(s)) {
				maps.put(s, i);
			} else {
				// add the first word that appear
				if (maps.get(s) >= 0) {
					result.add(strs[maps.get(s)]);
					maps.put(s, -1);
				}
				result.add(temp);
			}

		}
		return result;
	}