My First Programming
🖇️프로그래머스
+m개 씩 for문을 돌려서 해결
function solution(k, m, score) { let answer = 0; score.sort((a, b) => b - a); for (let i = 0; i < score.length - (score.length % m); i += m) { answer += score[i + m - 1] * m; } return answer; }