3 ms·
In 1/2 as many swaps: for x in [0 ... VA.length] ind = VA.get(x)-1 while ind != x VA.swap(x, ind) ind = VA.get(x)-1
by anonymoushn 15y ago
In 1/2 as many swaps:
for x in [0 ... VA.length]
ind = VA.get(x)-1
while ind != x
VA.swap(x, ind)
ind = VA.get(x)-1