Skip to content

Commit cb91eed

Browse files
author
patrick.fischer
committed
first def
1 parent 12de752 commit cb91eed

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

19/day01.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,13 @@
77
For a mass of 14, dividing by 3 and rounding down still yields 4, so the fuel required is also 2.
88
For a mass of 1969, the fuel required is 654.
99
For a mass of 100756, the fuel required is 33583.
10-
'''
10+
'''
11+
12+
13+
def fuel(mass: int) -> int:
14+
return mass//3 - 2
15+
16+
17+
assert fuel(12) == 2
18+
assert fuel(14) == 2
19+
assert fuel(1969) == 654

0 commit comments

Comments
 (0)