From 825a2bdbef1904f975c80ad0771feb8adb05ffc5 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 28 Nov 2024 06:47:52 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=8A=88=20#400=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=86=94=EB=A3=A8=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Programmers/\354\235\230\354\203\201.cpp" | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "Programmers/\354\235\230\354\203\201.cpp" diff --git "a/Programmers/\354\235\230\354\203\201.cpp" "b/Programmers/\354\235\230\354\203\201.cpp" new file mode 100644 index 0000000..72b20fc --- /dev/null +++ "b/Programmers/\354\235\230\354\203\201.cpp" @@ -0,0 +1,20 @@ +#include +#include +#include + +using namespace std; + +int solution(vector> clothes) { + unordered_map m; + + for (const auto& item : clothes) { + m[item[1]]++; + } + + int combinations = 1; + for (const auto& pair : m) { + combinations *= (pair.second + 1); + } + + return combinations - 1; +} \ No newline at end of file