4 ms·
I see so something like "abac" is basically mapped to 0 1 0 2 by mapping the lowest-order element in that sequence to 0, and the others following suit. In which
by kazinator 10y ago
I see so something like "abac" is basically mapped to 0 1 0 2 by mapping the lowest-order element in that sequence to 0, and the others following suit. In which case, it would be expected that, say, "xyxz" could be used in place of "abac".
"Auto-indexifying" a sequence in this way does seem like a useful little operation to have.
- Avshalom 10y agoGrade up (or grade down) returns the index of an array in sorted order. So >"weasels" would return: 0 3 6 5 1 4 2.