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