function solution(clothes) {
let answer = 1;
let hash = {};
for (const [name, kind] of clothes) {
hash[kind] = hash[kind] ? hash[kind] + 1 : 1;
}
for (const key in hash) answer *= (hash[key] + 1);
return answer - 1;
}