Concept Flow - Subsets Generation Using Bitmask
Start with input array
Calculate total subsets = 2^n
For each number from 0 to 2^n - 1
Use bits of number as mask
For each bit position
Include element at that position
Add formed subset to result
Repeat until all numbers processed
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.
