2 Calculate the number of assignment pairs, where
3 one range fully contains the other.
8 with open("4.in") as fh:
13 for elf in line.split(","):
14 elf_s, elf_e = [int(x) for x in elf.split("-")]
20 elf0_contains_elf1 = (
21 elves[0]["start"] <= elves[1]["start"]
22 and elves[0]["end"] >= elves[1]["end"]
24 elf1_contains_elf0 = (
25 elves[1]["start"] <= elves[0]["start"]
26 and elves[1]["end"] >= elves[0]["end"]
29 if elf0_contains_elf1 or elf1_contains_elf0: