[프로그래머스]할 일 목록

박예림·2023년 6월 6일
0

코테

목록 보기
131/132


import java.util.*;
class Solution {
    public String[] solution(String[] todo_list, boolean[] finished) {
        List<String> temList = new ArrayList<>();

        for(int i = 0; i<todo_list.length;i++){
            if(finished[i]==false){
                temList.add(todo_list[i]);
            }
        }

        String[] answer = temList.toArray(new String[temList.size()]);

        return answer;
    }
}
profile
응애 나 아기개발자

0개의 댓글