Hi there,
I found this really helpful topic on finding missing elements in a list of integers.
I found the second answer most useful and am applying it now to my code:
def missing_elements(X):
start, end = X[0], X[-1]
return sorted(set(range(start, end + 1)).difference(X))
Now, the problem is that I do not have a list, but a series of list of which this is a snapshot:
[716, 717, 718, 719, 720, 721]
[761, 762, 763, 764, 765, 766, 767, 768]
[988, 989, 990, 993, 994]
I would like to see as a result something like:
[0]
[0]
[991, 992]
Obviously, the above code is not working. But I have no idea of how to get it working. I get the impression that I might want to make this into a set and do something with set type features, but that's only a guess...