Day 05
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
print(sum(b>=x<=a<=y>=b or y>=a<=x<=b>=y for a,b,x,y in(map(int,l.strip().replace(',', '-').split('-'))for l in open("input.txt"))))
|
||||
print(sum(b>=x<=a<=y>=b or y>=a<=x<=b>=y for a,b,x,y in(map(int,l.strip().replace(',','-').split('-'))for l in open("input.txt"))))
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
print(sum(x<=a<=y or x<=b<=y or a<=x<= b or a<=y<=b for a,b,x,y in(map(int,l.strip().replace(',', '-').split('-'))for l in open("input.txt"))))
|
||||
print(sum(not(b<x or a>y)for a,b,x,y in(map(int,l.strip().replace(',','-').split('-'))for l in open("input.txt"))))
|
||||
|
||||
Reference in New Issue
Block a user