DEV Community

Discussion on: Daily Challenge #274 - Aerial Firefighting

Collapse
 
bb4l profile image
bb4L

Nim:

import sequtils, math, strutils

proc waterbombs*(ground: string, bombLength: int): int =
    return ground.split("Y").foldl(a+ceil(len(b)/bombLength).toInt(), 0)