Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Number Theory
- string
- Tree
- Matrix
- 파이썬
- Binary Search
- Math
- Method
- 구현
- sorting
- Data Structure
- Stack
- array
- 코테
- Counting
- hash table
- implement
- 자바
- two pointers
- java
- database
- 코딩테스트
- bit manipulation
- dynamic programming
- greedy
- SQL
- geometry
- Binary Tree
- simulation
- Class
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 할 일 목록 본문
1. Input, Output, Example
- todo_list에서 아직 마치지 못한 일들을 순서대로 담은 문자열 배열을 반환
2. Constraint
1) 1 ≤ todo_list의 길이 1 ≤ 100
2) 2 ≤ todo_list의 원소의 길이 ≤ 20
3) todo_list의 원소는 영소문자로만 이루어져 있다.
4) todo_list의 원소는 모두 서로 다르다.
5) finished[i]는 true 또는 false이고 true는 todo_list[i]를 마쳤음을, false는 아직 마치지 못했음을 나타낸다.
6) 아직 마치지 못한 일이 적어도 하나 있다.
3. Code
1) 첫 코드(2023/04/25)
import java.util.*;
class Solution {
public String[] solution(String[] todo_list, boolean[] finished) {
ArrayList<String> list = new ArrayList<>();
for(int i=0 ; i<todo_list.length ; i++)
if(!finished[i])
list.add(todo_list[i]);
return list.toArray(new String[0]);
}
}
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 배열의 원소 삭제하기 (0) | 2023.04.25 |
---|---|
[프로그래머스/Lv.0] ad 제거하기 (0) | 2023.04.25 |
[프로그래머스/Lv.0] 마지막 두 원소 (0) | 2023.04.25 |
[프로그래머스/Lv.0] 문자열 바꿔서 찾기 (0) | 2023.04.25 |
[프로그래머스/Lv.0] 수 조작하기 1 (0) | 2023.04.25 |