DEV Community

Discussion on: Daily Challenge #274 - Aerial Firefighting

Collapse
harrisgeo88 profile image
Harris Geo 👨🏻‍💻

Javascript solution

const waterbombs = (town, w) => {
   return town.split('Y')
     .map(t => Math.ceil(t.length / w))
     .reduce((a,b) => a + b)
}