Turns out I actually need to solve a harder problem: Find the permutation so that the arithmetic difference between smallest and largest integer after permutation is minimal.https://twitter.com/oe1cxw/status/1119226244992774144 …
If you mean a brute force search ... wouldn't there be 32! (factorial) permutations? What I ended up doing has approx O(N^2*M) complexity for N bits and M values, and tries to find a permutation and a XOR mask to minimize both the max value and the delta between min and max.
-
-
Oh, I read permutation as rotation. Yeah, that wouldn't work. :)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.