14 lines
273 B
Python
14 lines
273 B
Python
from common import Range, parse
|
|
|
|
|
|
def solve(input: list[tuple[Range, Range]]) -> int:
|
|
return len(list(filter(lambda x: x[0].overlaps_with(x[1]) or x[1].overlaps_with(x[0]), input)))
|
|
|
|
|
|
def main():
|
|
print(solve(parse("input")))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|