Remix.run Logo
vaylian 2 days ago

It would set a[i] to zero instead of swapping two values, right?

praptak a day ago | parent [-]

Yes. Now we only need a legit use case for code that swaps values only if they are in different locations, otherwise zeroes the aliased location. Then we can finally do it using the xor swap!