3 ms·
If the same character occurs twice in the window, the second OR will have no effect but the AND will remove it. The trick is that XOR will leave the bit set if
by rep_lodsb 4y ago
If the same character occurs twice in the window, the second OR will have no effect but the AND will remove it.
The trick is that XOR will leave the bit set if there is an odd number of occurrences, and the only way to have the bit count equal the window size is if every char is unique.