I tried a few different functions setups for calculating the fuel with expensive. While using the set() and list methods seemed slightly faster, it likely uses quite a bit more memory on larger datasets (lists in particular).
Tried:
costs = set()
for location in range(len(self.positions) + 1):
costs.add(self.calc_fuel_pricey(location))
return min(costs)
costs = []
for location in range(len(self.positions) + 1):
costs.append(self.calc_fuel_pricey(location))
return min(costs)
I tried a few different functions setups for calculating the fuel with expensive. While using the set() and list methods seemed slightly faster, it likely uses quite a bit more memory on larger datasets (lists in particular).
Tried:
```
costs = set()
for location in range(len(self.positions) + 1):
costs.add(self.calc_fuel_pricey(location))
return min(costs)
```
```
costs = []
for location in range(len(self.positions) + 1):
costs.append(self.calc_fuel_pricey(location))
return min(costs)
```
I tried a few different functions setups for calculating the fuel with expensive. While using the set() and list methods seemed slightly faster, it likely uses quite a bit more memory on larger datasets (lists in particular).
Tried:
69d3178bf4
.