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