File tree Expand file tree Collapse file tree
프로그래머스/1/12935. 제일 작은 수 제거하기 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# [ level 1] 제일 작은 수 제거하기 - 12935
22
3- [ 문제 링크] ( https://school.programmers.co.kr/learn/courses/30/lessons/12935 )
3+ [ 문제 링크] ( https://school.programmers.co.kr/learn/courses/30/lessons/12935?language=java )
44
55### 성능 요약
66
7- 메모리: 10.3 MB, 시간: 0.02 ms
7+ 메모리: 94.9 MB, 시간: 1.72 ms
88
99### 구분
1010
1616
1717### 제출 일자
1818
19- 2024년 06월 27일 17:07:03
19+ 2026년 06월 25일 21:37:20
2020
2121### 문제 설명
2222
Original file line number Diff line number Diff line change 1+ class Solution {
2+ public int [] solution (int [] arr ) {
3+ if (arr .length == 1 ) return new int [] {-1 };
4+ int mini = arr [0 ];
5+ for (int i : arr ) mini = Math .min (mini , i );
6+
7+ int idx = 0 ;
8+ int [] ans = new int [arr .length - 1 ];
9+ for (int i = 0 ; i < arr .length ; i ++) if (arr [i ] != mini ) ans [idx ++] = arr [i ];
10+ return ans ;
11+ }
12+ }
You can’t perform that action at this time.
0 commit comments