Coding Trainer

Subsets

MediumBacktrackingLC #78

Problem

Given an array of unique integers, return all possible subsets (the power set). Solution must not contain duplicates.

Example: nums=[1,2,3] → [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]