This website works better with JavaScript.
Home
Help
Sign In
ryanreed
/
advent-of-code-2021
Watch
1
Star
0
Fork
0
Code
Pull Requests
0
Releases
0
Activity
Browse Source
Simplifying logic
pull/7/head
Ryan Reed
3 years ago
parent
508d4ed992
commit
c42c2041ee
1 changed files
with
1 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+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
)
Write
Preview
Loading…
Cancel
Save