Given an integer array nums of unique elements, return every possible subset (the power set). The example input is 123; the expected output contains 8 arrays — every combination of “in” and “out” choices, including the empty set.
The easiest subset to miss is the empty set — the subset that contains nothing. Your brain doesn't bother remembering something made of nothing.
The first time I listed all subsets of 123 on a whiteboard, I confidently wrote seven, underlined the list, said “done.” The interviewer waited. I counted again. Seven. Always seven. What I'd missed was the empty set — the subset that contains nothing and is therefore the easiest to omit, because your brain doesn't bother remembering something made of nothing.
I want you to feel that small, specific embarrassment before I hand you the tool. Write every subset of 123. Use the chip palette. Add rows. When you think you have them all, press Submit.
Elements available
Your subsets0 committed