MapleStory Finger Point

๐Ÿƒ‍โ™€๏ธprogrammers/Java

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - java ํ•  ์ผ ๋ชฉ๋ก

HYEJU01 2024. 5. 2. 09:47

๐Ÿ’ก๋งˆ์น˜์ง€ ๋ชปํ•œ ์ผ์„ ์ˆœ์„œ๋Œ€๋กœ ๋‹ด์€ ๋ฌธ์ž์—ด๋ฐฐ์—ด์„ ๋ฆฌํ„ดํ•˜๋ผ

todo_list ์—์„œ finished ๊ฐ€ false ์ธ ๊ฐ’๋“ค๋งŒ ๋ฌธ์ž์—ด ๋ฐฐ์—ด์— ๋„ฃ์–ด์ฃผ๋ฉด ๋œ๋‹ค.

 

import java.util.ArrayList;

class Solution {
    public  ArrayList <String> solution(String[] todo_list, boolean[] finished) {
       ArrayList <String> answer = new ArrayList<>();
        
        
        for (int i = 0 ; i < todo_list.length; i++){
            if (finished[i] == false){
              answer.add(todo_list[i]);
            }   
        }

        return answer;
    }
}