day11: testing for set() and len(set()) > 0 is the same

This commit is contained in:
Stefan Harmuth 2021-12-11 06:49:39 +01:00
parent 65c31164f5
commit ed80d29609

View File

@ -20,7 +20,7 @@ def flashGrid(grid: Grid) -> int:
flashers.add(c)
did_flash = set()
while len(flashers) > 0:
while flashers:
thisFlash = flashers.pop()
did_flash.add(thisFlash)
grid.set(thisFlash, 0)