From 3dbab61f5c7220984f694fb559f2cebcb98a8dd1 Mon Sep 17 00:00:00 2001 From: LiiNi-coder <97495437+LiiNi-coder@users.noreply.github.com> Date: Sat, 15 Nov 2025 23:58:06 +0900 Subject: [PATCH] =?UTF-8?q?[20251115]=20PGM=20/=20LV2=20/=20=EC=9D=98?= =?UTF-8?q?=EC=83=81=20/=20=EC=9D=B4=EC=9D=B8=ED=9D=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15 PGM \354\235\230\354\203\201.md" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "LiiNi-coder/202511/15 PGM \354\235\230\354\203\201.md" diff --git "a/LiiNi-coder/202511/15 PGM \354\235\230\354\203\201.md" "b/LiiNi-coder/202511/15 PGM \354\235\230\354\203\201.md" new file mode 100644 index 00000000..68e28c69 --- /dev/null +++ "b/LiiNi-coder/202511/15 PGM \354\235\230\354\203\201.md" @@ -0,0 +1,21 @@ +```java +import java.util.*; + +class Solution { + public int solution(String[][] clothes) { + Map countByType = new HashMap<>(); + for (String[] cloth : clothes) { + String type = cloth[1]; + countByType.put(type, countByType.getOrDefault(type, 0) + 1); + } + int combinations = 1; + for (int count : countByType.values()) { + combinations *= (count + 1); + } + combinations -= 1; + + return combinations; + } +} + +```