문제풀이:
#include <string>
#include <vector>
using namespace std;
vector<string> solution(vector<string> todo_list, vector<bool> finished) {
vector<string> answer;
for (int i = 0; i < finished.size(); ++i) {
if (!finished[i]) { // 아직 마치지 못한 일인 경우
answer.push_back(todo_list[i]); // 결과 배열에 추가
}
}
return answer;
}
'코딩테스트' 카테고리의 다른 글
프로그래머스_0단계_홀수 vs 짝수 C++ (0) | 2024.04.23 |
---|---|
프로그래머스_0단계_5명씩 C++ (0) | 2024.04.23 |
프로그래머스_2단계_올바른 괄호_C++ (0) | 2024.04.11 |
프로그래머스_2단계_구명보트_C++ (0) | 2024.04.11 |
프로그래머스_1단계_문자열 내 p와 y의 개수_C++ (0) | 2024.04.11 |