This commit is contained in:
magical 2025-12-06 04:24:34 +00:00
parent db8befc81f
commit 7e9d5f0f93

View File

@ -39,7 +39,7 @@ def solve(input):
break
if found:
#print("collapsing ({:,} {:,}) and ({:,} {:,}) -> ({:,} {:,})".format(x,y,lo,hi,min(x,lo),max(y,hi)))
# if x <= lo <= hi < y then the range is unchanged and we don't need to update flattened[i].
# if x <= lo <= hi <= y then the range is unchanged and we don't need to update flattened[i].
# otherwise we need to add the new range to the queue to see if it can be merged with any other entries.
if lo < x or hi > y:
del flattened[i]