18 lines
448 B
Python
18 lines
448 B
Python
input = open("./test.txt", "r")
|
|
|
|
total = 0
|
|
|
|
for line in input:
|
|
trimmedLine = line.replace("\n", "")
|
|
elves = trimmedLine.split(",")
|
|
elf1 = elves[0].split("-")
|
|
elf1 = [int(elf1[0]), int(elf1[1])]
|
|
elf2 = elves[1].split("-")
|
|
elf2 = [int(elf2[0]), int(elf2[1])]
|
|
if (elf1[0] <= elf2[0] and elf1[1] >= elf2[1]):
|
|
total += 1
|
|
elif (elf2[0] <= elf1[0] and elf2[1] >= elf1[1]):
|
|
total += 1
|
|
elif(elf1[0] >= elf2[0] or elf)
|
|
|
|
print(total) |