← All problems

Subsets

medium

Given an array nums of unique integers, return all possible subsets (the power set). You may return them in any order.

Example

Input: nums = [1, 2, 3]
Output: [[], [1], [2], [3], [1,2], [1,3], [2,3], [1,2,3]]
Loading...