Skip to content

Commit e179ccf

Browse files
authored
[tkddbs587] 25.01.23 (#32)
* String calculation / 기초 * fork 레포에서 폴더 옮김 * Control z / 기초 * I_hate_english / 기초 * String_reversal / 기초 * Valid_parentheses / 중급 * Crane_claw_machine_game / 중급 * Number_of_ordered_pairs / 기초 * Dart_game / 중급 * Find_point_position / 기초 * Card_bundle / 중급 * Login_success / 기초 * Make_burger / 중급 * Set_treatment_order / 기초 * Ranking / 기초 * Make_b_from_a / 기초 * Morse_code / 기초 * Athlete_who_did_not_finish / 중급
1 parent 4790475 commit e179ccf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function solution(participant, completion) {
2+
// 두 배열 sort로 정렬
3+
participant.sort();
4+
completion.sort();
5+
6+
// 참가자 배열 길이만큼 순회
7+
for (let i = 0; i < participant.length; i++) {
8+
// 참가자 배열에 [i]와 완주자 배열의[i]가 다르면 탈락한 참가자로 판단
9+
if (participant[i] !== completion[i]) {
10+
return participant[i];
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)