- 문제
2. 내 해결법
const solution = (progresses, speeds) => {
const answer = progresses.map((job, idx) =>
Math.ceil((100 - job) / speeds[idx])
);
let base = answer[0];
let score = [0];
answer.forEach((val) => {
if (val <= base) {
score[score.length - 1] += 1;
} else {
base = val;
score[score.length] = 1;
}
});
return score;
};