switching from df manipulation to a for loop as a primary overlap calculator
the function no longer relies on intersecting entire segments of characters, instead, its complexity grows only with the number of codes in the document, not their size
there are huge performance improvements
it proceeds algorithmically, pausing at each code break and looking back if any other code is also still valid at the given position
from the previous solution, i carried over indexing of segments starting at 0 - not sure why it was done so in the first place, but it works, so i am not trying to fix it, maybe there was a good reason for that