11 ms·
⍴((U⍳U)=⍳⍴U)/U for counting the unique is wasteful too, as we only need the count, not the actual items, so +/(U⍳U)=⍳⍴U or (U⍳U)+.=⍳⍴U is enough.
by abrudz 3y ago
⍴((U⍳U)=⍳⍴U)/U for counting the unique is wasteful too, as we only need the count, not the actual items, so +/(U⍳U)=⍳⍴U or (U⍳U)+.=⍳⍴U is enough.