위장 https://programmers.co.kr/learn/courses/30/lessons/42578
for in
을 이용해 객체 key값 이용,function solution(clothes) {
let answer = 1;
const hash = [];
for (let i = 0; i < clothes.length; i++) {
hash[clothes[i][1]] = (hash[clothes[i][1]] || 0) + 1;
}
for (let key in hash) {
answer = answer * (hash[key] + 1);
}
return answer - 1;
}