Talk:Best shuffle: Difference between revisions

m
hopefully clarify a point which was perhaps glossed over
m (hopefully clarify a point which was perhaps glossed over)
Line 27:
Here, 'a' is the most frequently occurring character and it appears at character indices 0, 3, 5, 7 and 10.
 
Next we find the number of occurrences of the most frequently occurring character and we group these rearranged indices into that many distinct groups. In other words if <code>equivs=: (\:#&>)@:(<@I.@=) y=:'abracadabra'</code>, we need 5 distinct groups of indices to separate the five instances of the letter 'a'. We do this by taking the grouped character indices from before, ignoring the grouping and counting to 5, repeatedly (the first index goes in the first group, the second goes in the second group, and so on):
 
<lang j> (i.#y) |~ #>{. equivs
6,962

edits