DEV Community

Discussion on: Daily Challenge #274 - Aerial Firefighting

Collapse
 
londyf profile image
Londy • Edited

Javascript:

const waterBombs = (fire, width) => fire
    .split("Y")
    .reduce((a, b) => a + Math.ceil(b.length / width), 0);