https://programmers.co.kr/learn/courses/30/lessons/42889
function solution(N, stages) {
let answer=[];
let arr=Array.from({length:N+1}, ()=>0);
let map=new Map();
for(let i=1; i<=N; i++){
let under=0, top=0;
for(let j=0; j<stages.length; j++){
if(stages[j]>=i) under++;
if(stages[j]===i) top++;
}
map.set(i, top/under);
}
map=[...map].sort((a, b)=>b[1]-a[1]);
for(let x of map){
answer.push(x[0]);
}
return answer;
}
[...map].sort((a, b)=>b[1]-a[1]);
.
10/26