import java.util.HashMap;
import java.util.Iterator;
class Solution {
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);
}
Iterator<Integer> it = map.values().iterator();
int answer = 1;
while(it.hasNext())
answer *= it.next().intValue() +1; //옷을 안입을 경우
return answer - 1; //모든 옷을 안입을 경우는 제외
}
public static void main(String[] args) {
String[][] clothes = {{"yellowhat","headwear"},{"bluesunglasses","eyewear"}};
Solution solution = new Solution();
System.out.println(solution.solution(clothes));
}
}