Skip to content

Commit 26aa64a

Browse files
committed
[level 1] Title: 완주하지 못한 선수, Time: 373.44 ms, Memory: 96.9 MB -BaekjoonHub
1 parent a8ab95c commit 26aa64a

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

프로그래머스/1/42576. 완주하지 못한 선수/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### 성능 요약
66

7-
메모리: 96.9 MB, 시간: 356.66 ms
7+
메모리: 96.9 MB, 시간: 373.44 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2025년 01월 20일 17:06:17
19+
2025년 09월 09일 22:48:22
2020

2121
### 문제 설명
2222

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
import java.util.HashMap;import java.util.Arrays;
2-
3-
1+
import java.util.Arrays;
42
class Solution {
5-
public String solution(String[] participant, String[] completion) {
3+
public String solution(String[] participant, String[] completion) {
64
Arrays.sort(participant);
75
Arrays.sort(completion);
8-
int i;
9-
for(i=0;i<completion.length;i++){
10-
if(!participant[i].equals(completion[i])){
6+
for(int i=0; i<completion.length; i++){
7+
if(!participant[i].equals(completion[i])) {
118
return participant[i];
129
}
1310
}
14-
return participant[i];
15-
11+
return participant[participant.length-1];
1612
}
1713
}

0 commit comments

Comments
 (0)