diff --git a/puzzles/day07.py b/puzzles/day07.py index 36301ce..127bcd5 100644 --- a/puzzles/day07.py +++ b/puzzles/day07.py @@ -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