Browse Source

Speeding up the cost search

pull/7/head
Ryan Reed 3 years ago
parent
commit
c0e66a9374
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      puzzles/day07.py

+ 1
- 1
puzzles/day07.py View File

@ -20,7 +20,7 @@ class AlignCrabSubs:
def calc_fuel(self, pricey: bool = False) -> int:
if pricey:
fuel = None
for position in range(len(self.positions) + 1):
for position in range(len(set(self.positions)) + 1):
price = self.calc_fuel_pricey(position)
if fuel is None or fuel > price:
fuel = price


Loading…
Cancel
Save