summaryrefslogtreecommitdiffstats
path: root/solutions/py/01-2.py
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2019-12-08 11:06:56 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2019-12-08 11:06:56 +0100
commit29e33f8f6a31565f5a2671b1c459ff1b829630f7 (patch)
treec051274a9e9a895049a077a6bdce9056dfb9afb1 /solutions/py/01-2.py
parentd16fc72a33fced8c8623bea6cf9cdd9cf8999024 (diff)
downloadaoc-29e33f8f6a31565f5a2671b1c459ff1b829630f7.tar.gz
Refactor and create main.py
Diffstat (limited to 'solutions/py/01-2.py')
-rw-r--r--solutions/py/01-2.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/solutions/py/01-2.py b/solutions/py/01-2.py
deleted file mode 100644
index 0017a8b..0000000
--- a/solutions/py/01-2.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import math
-import sys
-
-def get_fuel(mass):
- fuel = math.floor(mass / 3) - 2
- if fuel <= 0:
- return 0
- return fuel + get_fuel(fuel)
-
-fuels = []
-for line in sys.stdin:
- if line.rstrip() == "":
- break
- fuels.append(get_fuel(int(line)))
-
-print(sum(fuels))