set for p1
This commit is contained in:
parent
192a9c046e
commit
0d4800e51f
@ -9,10 +9,9 @@ def main():
|
|||||||
e1, e2 = line.split(',')
|
e1, e2 = line.split(',')
|
||||||
e1_from, e1_to = map(int, e1.split('-'))
|
e1_from, e1_to = map(int, e1.split('-'))
|
||||||
e2_from, e2_to = map(int, e2.split('-'))
|
e2_from, e2_to = map(int, e2.split('-'))
|
||||||
#r1 = range(int(e1_from), int(e1_to) +1)
|
r1 = list(range(e1_from, e1_to +1))
|
||||||
#r2 = range(int(e2_from), int(e2_to) +1)
|
r2 = list(range(e2_from, e2_to +1))
|
||||||
if (e1_from <= e2_from and e1_to >= e2_to ) or \
|
if set(r1).issubset(r2) or set(r2).issubset(r1):
|
||||||
( e2_from <= e1_from and e2_to >= e1_to ):
|
|
||||||
includes += 1
|
includes += 1
|
||||||
print(includes)
|
print(includes)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user