4 ms·
You halve the remaining length each time there is a match and only exit the loop when length is 0 so it should be the first one.
by badtension 3y ago
You halve the remaining length each time there is a match and only exit the loop when length is 0 so it should be the first one.