Sliding window is a little different from two pointer. I personally found it hard to understand how, thus this article.
*## Logical
N bits outAll you need to do, is to and it with a 0000 0000 mask (for a one byte value in this example).
Mask it with 0000 0001. Even numbers have 0 at the end, and uneven - 1. anding an even number with 0000 0001 will result in 0 and anding an uneven - with 1.
AND operation will be used to check if the given bit in the bit map was set already: if bit_vector & (1 << char_code). 1 « char_code basically does the following (using 8 bit value for simplicity). Say, we checking if either of the numbers appeared more than once in some data (numbers from 0 to 7).