Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- spring
- Algorithm
- intent
- broadcastreceiver
- 알고리즘
- 데이터전달
- 16197
- 제어반전
- service
- 프로그래머스
- mysql
- 백준
- Jenknis
- 데이터
- Java
- Android
- activity
- goland
- insert
- 안드로이드
- data
- git
- 두 동전
- ubuntu
- vscode
- 단축키
- 큐빙
- IntelliJ
- github
- 17837
Archives
- Today
- Total
해보자
프로그래머스_LV2_위장 본문
https://programmers.co.kr/learn/courses/30/lessons/42578
코딩테스트 연습 - 위장 | 프로그래머스
programmers.co.kr

#include <vector>
#include <map>
#include <string>
using namespace std;
int solution(vector<vector<string>> clothes) {
int answer = 1;
map<string, int> m;
for (int i = 0; i < clothes.size(); i++) {
m[clothes[i][1]]++;
}
for (map<string, int>::iterator it = m.begin(); it != m.end(); it++) {
answer = answer * (it->second + 1);
}
answer = answer - 1;
return answer;
}