Browse Source

Simplifying logic

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

+ 1
- 1
puzzles/day07.py View File

@ -21,7 +21,7 @@ class AlignCrabSubs:
target = median(self.positions)
fuel = 0
for num in self.positions:
fuel += num - target if num > target else target - num
fuel += abs(num - target)
return int(fuel)


Loading…
Cancel
Save