[JavaScript] 야근 지수
level : 3 문제 링크 : 야근 지수 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr My Solution function solution(n, works) { let answer = 0; let maxheap = []; for(let i of works) insert(maxheap,i); while(n>0){ const max = maxheap[0]; remove(maxheap); insert(maxheap,max > 0 ? max - 1 : 0); n--; } answer += maxheap.reduce((pre,cur)=>pre+cur**2,0)..
2022.09.17