3 ms·
What does this algorithm do? As far as I can tell there's only an effect if len is wrong, or the list has length 2^31-1 and ends with a. Even if you move i out
by johncolanduoni 10y ago
What does this algorithm do? As far as I can tell there's only an effect if len is wrong, or the list has length 2^31-1 and ends with a.
Even if you move i out of the for loop, you would just get whether the list ends in "a".
Edit: Whoops, 2^31-2 is sufficient for the overflow and i's value at the end of the loop is more subtle than I gave it credit for.