function solution(progresses, speeds) {
const stack = [];
const answer = [];
let count = 0;
const day = progresses.map((element,index)=>{
return Math.ceil((100-element)/speeds[index]);
});
stack.push(day[0]);
count++;
for(let i = 1; i<day.length; i++){
if(day[i]<=stack[0]){
count++;
} else {
const remove = stack.shift();
answer.push(count);
stack.push(day[i]);
count = 1;
}
}
answer.push(count)
return answer;
}