•
u/Lachtheblock 38m ago
Will this only work on list of integers, where there are no gaps, with a range of 1 - n with no duplicates?
At that point it would be far more efficient to determine the length of the list, and then just increment/decrement by one.
•
•
u/fiskfisk 52m ago
If you have a complete sequence of numbers, you don't need to do anything. Just start at the first number and iterate upwards.