6 ms·
Note that this can equivalently[0] (and more readably) be written as `(a/2) + (b/2) + (a&b&1)`. 0: Assuming your language rounds integer division and modulo co
by a1369209993 4y ago
Note that this can equivalently[0] (and more readably) be written as `(a/2) + (b/2) + (a&b&1)`.
0: Assuming your language rounds integer division and modulo correctly, ie that `i%array_len` is reliably a valid array index. C has problems here when i (respectively: a or b) is signed, but that doesn't matter in the sensible case, where you always index everything with size_t.