We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d7db95 commit dc58fe5Copy full SHA for dc58fe5
1 file changed
src/Do-ho/dataStructor/pgs_위장/pgs_위장.js
@@ -0,0 +1,8 @@
1
+const solution = clothes => {
2
+ const clothesObject = clothes.reduce((acc, [name, kind]) => {
3
+ acc.hasOwnProperty(kind)? acc[kind] += 1 : acc[kind] = 1;
4
+ return acc;
5
+ }, new Object());
6
+
7
+ return Object.values(clothesObject).reduce((acc, val) => acc *= val + 1, 1) - 1;
8
+}
0 commit comments