-
[Programmers] 완주하지 못한 선수STUDYING/Algorithm 2021. 9. 27. 00:33728x90
https://programmers.co.kr/learn/courses/30/lessons/42576
C++
#include <string> #include <vector> #include <algorithm> using namespace std; string solution(vector<string> participant, vector<string> completion) { string answer = ""; sort(participant.begin(), participant.end()); sort(completion.begin(), completion.end()); for(int i; i < participant.size(); i++){ if(participant[i] != completion[i]){ answer = participant[i]; return answer; } } answer = participant[participant.size() - 1]; return answer; }
#include <strin
'STUDYING > Algorithm' 카테고리의 다른 글
[Programmers] 모의고사 (0) 2021.09.27 [Programmers] K번째 수 (0) 2021.09.27 [Programmers] 멀쩡한 사각형 (0) 2021.09.27 [Programmers] 오픈채팅방 (0) 2021.09.27 [Programmers] 기능개발 (0) 2021.09.27