https://programmers.co.kr/learn/courses/30/lessons/42578

int solution(vector<vector<string>> clothes) {
	int answer = 1;
	std::unordered_map<string, vector<string>> um;
	std::vector<string> v;
	for (int i = 0; i < clothes.size(); i++)
	{
		if (um.find(clothes[i][1]) == um.end())
			v.push_back(clothes[i][1]);
		um[clothes[i][1]].push_back(clothes[i][0]);
	}
	for (int i = 0; i < v.size(); i++)
	{
		answer *= (um[v[i]].size() + 1);
	}
	return answer - 1;
}

v 로 따로 string 저장했지만 다른 방법으로는 iterator 로 접근하기도 가능.