728x90 Math.abs()1 [프로그래머스] 주사위 게임 3 : JavaScript 📌 문제 📌 풀이function solution(a, b, c, d) { const numbers = [a, b, c, d]; const freqMap = {}; for (let num of numbers) { freqMap[num] = (freqMap[num] || 0) + 1; } const counts = Object.values(freqMap); const uniqueNumbers = Object.keys(freqMap).map(Number); if (counts.includes(4)) { const p = uniqueNumbers return 1111 * p } if (count.. 2025. 1. 19. 이전 1 다음 728x90