DEV Community

Discussion on: Daily Challenge #83 - Deodorant Evaporator

Collapse
 
delixx profile image
DeLiXx
function lifespan(evap_per_day, threshold) {
    let content = 100;
    let day = 0;
    while (fill >= threshold) {
        fill *= 1-(evap_per_day/100);
        day++;
    }
    return day;
}