Explain Bit Manipulation in the context of sets.

Explain Bit Manipulation in the context of sets.

Approach: Describe representing a subset as an integer.

The use of bits in an integer to represent a set of booleans. For example, the i-th bit being 1 indicates that the i-th element is present in the subset.

Follow-up: How do you check if the i-th bit is set?

Key concepts: bitmask, bitwise and/or/xor, shifts.