summaryrefslogtreecommitdiff
path: root/2022/day4/asd.py
diff options
context:
space:
mode:
authornekineki <nekineki@nekineki.net>2022-12-11 14:47:27 +0100
committernekineki <nekineki@nekineki.net>2022-12-11 14:50:32 +0100
commitfe75c10e350743a1c078f065d69556fecf825ca5 (patch)
tree956556a564c9329346dc9d8b1535dc5e365f3d55 /2022/day4/asd.py
parenta74d2dc54aef546664bcc8c81eb8e01a93e94391 (diff)
move files around, update paths
Diffstat (limited to '2022/day4/asd.py')
-rwxr-xr-x2022/day4/asd.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/2022/day4/asd.py b/2022/day4/asd.py
deleted file mode 100755
index 7989e3e..0000000
--- a/2022/day4/asd.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env python3
-
-# filename = "ref.txt"
-filename = "pzl.txt"
-res1 = 0
-res2 = 0
-with open(filename) as f:
- for line in f:
- line = line.strip()
- prvi,drugi = line.split(',')
- ps, pe = [int(i) for i in prvi.split('-')]
- ds, de = [int(i) for i in drugi.split('-')]
-
- if ps <= ds and pe >= de:
- res1 += 1
- elif ps >= ds and pe <= de:
- res1 += 1
-
- if ds <= pe <= de:
- res2 += 1
- elif ps <= de <= pe:
- res2 += 1
-
- print(res1)
- print(res2)
-