Why does this:
while (arr[i] == arr[i += shift]) { // not working
if (i == target)
return arr[i];
}
or this:
while (arr[i] == arr[i = (i + shift)]) { // not working
if (i == target)
return arr[i];
}
behave differently from this:
while (arr[i] == arr[i + shift]) { // works
i += shift;
if (i == target)
return arr[i];
}
My instinct is that ALL three should behave exactly the same.