> I really don't see what's supposedly awful about that loop
Exactly! That's precisely the problem with it.
(Hint: think about your code when size = 0.)
> I really don't see what's supposedly awful about that loop
Exactly! That's precisely the problem with it.
(Hint: think about your code when size = 0.)
It works perfectly fine for size = 0?
They meant x = 0.
Not sure if they meant that, since the “awful” was referring to the original loop that had no x, but the generic solution in that case is:
[dead]