DEV Community

Discussion on: Daily Challenge #274 - Aerial Firefighting

Collapse
 
vinaypai profile image
Vinay Pai

You can use the built-in sum function to simplify your solution.

import math
def waterbombs(fire, w):
  return sum(math.ceil(len(fr) / w) for fr in fire.split('Y'))
Collapse
 
peter279k profile image
peter279k

Thanks for your simplify code snippets.

But I want to make my code snippets readable :).