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 |
Tags
- git
- insert
- vscode
- Algorithm
- Jenknis
- Android
- intent
- spring
- 백준
- activity
- 제어반전
- service
- broadcastreceiver
- github
- 두 동전
- mysql
- 데이터
- 프로그래머스
- 단축키
- Java
- IntelliJ
- 안드로이드
- 큐빙
- 데이터전달
- 알고리즘
- 16197
- data
- ubuntu
- 17837
- goland
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;
}