Optimal Algorithmic Approach
DFS backtracking with a running subset that's saved at each node.
Core Invariants & Edge Cases
- Backtracking: at each index include or exclude the element
- Iterative bit-mask: for each number 0 to 2^n-1, collect set bits
- For duplicates: sort and skip equal adjacent elements after first use