Concept Flow - Subsets Generation Using Bitmask
Start with input set
Calculate total subsets = 2^n
For each number from 0 to 2^n - 1
Use bits of number as mask
Include elements where bit is 1
Add formed subset to result
Repeat until all subsets generated
Return all subsets
We generate all subsets by counting from 0 to 2^n-1 and using each number's bits to decide which elements to include.
