Skip to content

Commit bbd12d8

Browse files
committed
[20251112] PGM / LV2 / 의상 / 김민진
1 parent d2e3dbf commit bbd12d8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```java
2+
import java.util.HashMap;
3+
import java.util.Map;
4+
5+
public class PGM_LV2_의상 {
6+
7+
private static int ans;
8+
private static Map<String, Integer> clothes;
9+
10+
public int solution(String[][] cl) {
11+
clothes = new HashMap<>();
12+
ans = 1;
13+
14+
for (String[] c : cl) {
15+
clothes.put(c[1], clothes.getOrDefault(c[1], 0) + 1);
16+
}
17+
18+
for (String s : clothes.keySet()) {
19+
ans *= clothes.get(s) + 1;
20+
}
21+
22+
return ans - 1;
23+
}
24+
}
25+
```

0 commit comments

Comments
 (0)