I found numerous similar questions in other programming languages (ruby, C++, JS, etc) but not for Python. Since Python has e.g. itertools
I wonder whether we can do the same more elegantly in Python.
Let's say we have a "complete range", [1,100]
and then a subset of ranges within/matching the "complete range":
[10,50]
[90,100]
How can we extract the not covered positions, in this case [1,9]
, [51,89]
?
This is a toy example, in my real dataset I have ranges up to thousands.