Subsets

Try to solve the Subsets problem.

Statement

Given an array of integers, nums, find all possible subsets of nums, including the empty set.

Note: The solution set must not contain duplicate subsets. You can return the solution in any order.

Constraints:

  • 1≤1 \leq nums.length ≤10\leq 10
  • −10≤-10 \leq nums[i] ≤10\leq 10
  • All the numbers of nums are unique.

Examples

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy