completed 2017-02.2

This commit is contained in:
dusk 2025-07-24 23:07:02 +00:00
parent 0478a8789a
commit 8ec6322f51

21
2017/02/2checksum.py Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env python3
if __name__ == '__main__':
total = 0
with open("input", "r", encoding="utf-8") as sheet:
remainder = []
for line in sheet:
values = list(map(int, line.split()))
values.sort()
result = ""
i = 1
while i < len(values) and result == "":
j = 0
while j >= 0 and j < i and result == "":
remainder = values[i] % values[j]
if remainder == 0:
result = int(values[i] / values[j])
j += 1
i += 1
total += result
print(total)