프로그래머스 - 기능개발
https://school.programmers.co.kr/learn/courses/30/lessons/42586
function solution(progresses, speeds) {
var answer = [];
let workDays = progresses.map((el, i) => Math.ceil((100 - el) / speeds[i]));
for (let i = 0; i < workDays.length; i++) {
let completedWork = 1;
for (let j = i + 1; j < workDays.length; j++) {
if (workDays[i] >= workDays[j]) {
completedWork++;
} else {
break;
}
}
i += completedWork - 1;
answer.push(completedWork);
}
return answer;
}