void checkMagazine(vector<string> magazine, vector<string> note) {
//map<string, string> m;
sort(magazine.begin(), magazine.end());
sort(note.begin(), note.end());
if(includes(magazine.begin(), magazine.end(), note.begin(), note.end())){
cout << "Yes" << endl;
}
else{ cout << "No" << endl; }
}
includes
를 사용해서 note가 magazine의 subset이면 Yes를, 아니면 No를 출력한다.[HackerRank] Sorting: Bubble Sort (Sorting) (0) | 2021.01.16 |
---|---|
[HackerRank] Two Strings (python) (0) | 2021.01.14 |
[HackerRank] Birthday Cake Candles (C++, Python) (0) | 2021.01.14 |
[프로그래머스] 체육복 (탐욕법(Greedy)) (0) | 2021.01.13 |
[HackerRank] Left Rotation (Python, C++) (0) | 2021.01.12 |