Skip to content

Commit

Permalink
이슈 #400에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 28, 2024
1 parent 13c0ffb commit 825a2bd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Programmers/의상.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <string>
#include <vector>
#include <unordered_map>

using namespace std;

int solution(vector<vector<string>> clothes) {
unordered_map<string, int> m;

for (const auto& item : clothes) {
m[item[1]]++;
}

int combinations = 1;
for (const auto& pair : m) {
combinations *= (pair.second + 1);
}

return combinations - 1;
}

0 comments on commit 825a2bd

Please sign in to comment.