I represent a set of English alphabets as a 26 bit bitstring. The first bit corresponds to "a", the set bit to "b", etc. Thus,
The string ab is represented as 11000000000000000000000000
Now, given the two bit strings, I want to check if bitstring 1 is a subset of bit string 2. That is, in all places of bitstring 1 has β1β, bit 2 should also have β1β. This means that all characters in line1 are also present in line2. Can someone please let me know the best way to do this?
I know a simple way: iterate over the bit of string1 and check the corresponding bit in bit string2. However, I am wondering if this can be done using some bit operator in a more efficient way.
source share