Skip to content
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tkddbs587/Hash/Athlete_who_did_not_finish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function solution(participant, completion) {
// ๋‘ ๋ฐฐ์—ด sort๋กœ ์ •๋ ฌ
participant.sort();
completion.sort();

// ์ฐธ๊ฐ€์ž ๋ฐฐ์—ด ๊ธธ์ด๋งŒํผ ์ˆœํšŒ
for (let i = 0; i < participant.length; i++) {
// ์ฐธ๊ฐ€์ž ๋ฐฐ์—ด์— [i]์™€ ์™„์ฃผ์ž ๋ฐฐ์—ด์˜[i]๊ฐ€ ๋‹ค๋ฅด๋ฉด ํƒˆ๋ฝํ•œ ์ฐธ๊ฐ€์ž๋กœ ํŒ๋‹จ
if (participant[i] !== completion[i]) {
return participant[i];
}
Comment on lines +7 to +11
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•ด์š”!!

return participant.find((name, i) => name !== completion[i]);

}
}
Loading