#include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool SortSecCol(const vector<string>& v1, const vector<string>& v2){
return v1[1]<v2[1];
}
int solution(vector<vector<string>> clothes) {
int answer = 1;
int temp=0;
sort(clothes.begin(),clothes.end(),SortSecCol);
for(int j=0;j<clothes.size();j++){
if(j==clothes.size()-1){
if(clothes[1][j]==clothes[1][j-1]){
answer=answer*(temp+1)-1;}
else{
answer=answer*2-1;
}
}
else{
if(clothes[1][j]==clothes[1][j+1]){
temp++;
}
else{
temp++;
answer=answer*(temp+1);
temp=0;
}
}
}
return answer;
}
오답