DEV Community

Discussion on: Daily Challenge #83 - Deodorant Evaporator

Collapse
 
kvharish profile image
K.V.Harish • Edited

My solution in js


const evaporator = (netContent = 100, evapPerDay, threshold) => {
  let  nthDay = 0;  
  while (netContent >= threshold) {
    netContent -= (netContent * (evapPerDay / 100));
    nthDay++;
  }
  return nthDay;
}