diff options
author | b-idea <test@test.com> | 2023-07-15 17:41:49 +0200 |
---|---|---|
committer | b-idea <test@test.com> | 2023-07-15 17:41:49 +0200 |
commit | 711b4271603fce61330b33c67c172e0c580960b8 (patch) | |
tree | 92debe6ed1eb0d592616784a5b05fd880d9f7418 | |
parent | 5ee5cca9b31ab2d639f78446a6480e9bc5300377 (diff) |
test ssh
-rw-r--r-- | 2018/aoc18-d01-2.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/2018/aoc18-d01-2.py b/2018/aoc18-d01-2.py new file mode 100644 index 0000000..3462b14 --- /dev/null +++ b/2018/aoc18-d01-2.py @@ -0,0 +1,32 @@ + +f = open("input"); + +part1 = 0; +results = []; +not_found = True; +loopcount = 0; +myinput = []; + +for i in f: + myinput.append(int(i)); + +while not_found: + for i in myinput: + #print(i, "endofline"); + part1 += i; + results.append(part1); + #for x in results: + if (results.count(part1) > 1): + part2 = part1; + print(part2); + not_found = False; + break; + loopcount += 1; + #print("loop", loopcount); + +#results.sort(); +#for i in results: +# print(i); + +print(part1); +print(part2); |