https://programmers.co.kr/learn/courses/30/lessons/42578
import java.util.*;
class Solution {
public int solution(String[][] clothes) {
int answer = 0;
int num = 1;
HashMap<String , Integer> map = new HashMap<String , Integer>();
for(int i=0; i<clothes.length; i++) {
if(map.containsKey(clothes[i][1])){
map.put(clothes[i][1], map.get(clothes[i][1])+1);
}
else{
map.put(clothes[i][1], 1);
}
}
Set set = map.keySet();
Iterator iterator = set.iterator();
while (iterator.hasNext())
{
String key = (String)iterator.next();
num*=(map.get(key)+1);
}
answer = num-1;
return answer;
}
}