[프로그래머스] 모의고사 : JavaScript
📌 문제 📌 풀이function solution(answers) { const obj = {}; const score1 = [1, 2, 3, 4, 5]; const score2 = [2, 1, 2, 3, 2, 4, 2, 5]; const score3 = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5]; answers.forEach((v, i) => { if (v === score1[i % score1.length]) { obj[1] = (obj[1] || 0) + 1; } if (v === score2[i % score2.length]) { obj[2] = (obj[2] || 0) +..
2025. 3. 29.