⚠️ Subsets vs Substrings
The 30-Minute Debugging Mistake
Subsets (Wrong!)
Bug
(1 << n) - 1 = 2
n
- 1
0
Substrings (Correct!)
Fix
n × (n + 1) / 2
0