114. 할 일 목록

김해준's avatar
Dec 19, 2025
114. 할 일 목록

사용언어 : Java

문제
notion image
풀이
class Solution { public String[] solution(String[] todo_list, boolean[] finished) { int count = 0; for(int i = 0 ; i < todo_list.length; i++) if(!finished[i])count++; String[] answer = new String[count]; int index = 0; for(int i = 0 ; i < todo_list.length; i++) { if(!finished[i]) { answer[index] = todo_list[i]; index++; } } return answer; } }
notion image
Share article