I've been through it 4 times
& don't see how it works
I would build a 2nd array where the value of a1 is the index of a2, & you stop as soon as you get a duplicate:
for k=0..n
a2[a1[k]]++
if a2[a1[k]] > 1
break(unless you're looking for *more* than one duplicate)
— Warren Myers ?? (@warrenmyers) May 22, 2020
from Twitter https://twitter.com/warrenmyers
May 22, 2020 at 10:46AM
via IFTTT