public int solution(String[][] clothes) {
HashMap<String, Integer> map = new HashMap<>();
for (String[] clothe : clothes) {
String type = clothe[1];
map.put(type, map.getOrDefault(type, 0) + 1);
}
int answer = 1;
for (int count : map.values()) {
answer *= (count + 1);
}
return answer - 1;
}
출처:https://school.programmers.co.kr/learn/courses/30/lessons/42578