HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
📝
프론트엔드 스쿨 교안(1기)
/
📝
(코테준비) 자료구조 및 알고리즘
/
☝
JS 100제 - 1권
/
🔥
문제38
/
✔️
답안
✔️

답안

const scores = prompt('점수입력').split(' ').map(function(n){ return parseInt(n, 10); }); scores.sort((a, b) => { return a-b; }); let count = 0; let arr = []; while (arr.length < 3) { let n = scores.pop(); if (!arr.includes(n)){ arr.push(n); } count += 1; } console.log(count);