#7 Adding day07

Merged
ryanreed merged 5 commits from day07 into master 3 years ago
ryanreed commented 3 years ago
Owner

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) ```
ryanreed added 4 commits 3 years ago
ryanreed added 1 commit 3 years ago
ryanreed merged commit 69d3178bf4 into master 3 years ago
ryanreed referenced this issue from a commit 3 years ago
ryanreed deleted branch day07 3 years ago
The pull request has been merged as 69d3178bf4.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.