Skip to content

의상 #400

@fkdl0048

Description

@fkdl0048
#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;
}

Metadata

Metadata

Assignees

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions