We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fced5d commit 7ae53a0Copy full SHA for 7ae53a0
1 file changed
live8/test85/문제3/이상민.js
@@ -0,0 +1,15 @@
1
+function solution(clothes) {
2
+ let answer = 1;
3
+ const map = new Map();
4
+ for (const cloth of clothes) {
5
+ const [name, type] = cloth;
6
+ if (!map.has(type)) map.set(type, 1);
7
+ else map.set(type, map.get(type) + 1);
8
+ }
9
+
10
+ for (const key of map.keys()) {
11
+ answer *= map.get(key) + 1;
12
13
14
+ return answer - 1;
15
+}
0 commit comments