https://programmers.co.kr/learn/courses/30/lessons/42578
코딩테스트 연습 - 위장
programmers.co.kr
#include <string>
#include <vector>
#include <iostream>
#include <map>
using namespace std;
int solution(vector<vector<string>> clothes) {
int answer = 1;
map <string, int> myclothes;
for (int i = 0; i < clothes.size(); i++) {
myclothes[clothes[i][1]] += 1;
}
for (auto item : myclothes) {
answer *= (item.second + 1);
}
return answer - 1;
}
'APS > 프로그래머스' 카테고리의 다른 글
[2017 카카오코드 본선] 단체사진 찍기 C++ (0) | 2021.12.31 |
---|---|
[Summer/Winter Coding(~2018)] 영어 끝말잇기 C++ (0) | 2021.12.30 |
[Summer/Winter Coding(2019)] 멀쩡한 사각형 C++ (0) | 2021.12.18 |
[2018 KAKAO BLIND RECRUITMENT] [1차] 셔틀버스 C++ (0) | 2021.12.17 |
[그래프] 순위 C++ (0) | 2021.12.17 |