← 返回 bytedance 的题目列表Subsets
类型:online_judge
Given an integer array nums with distinct elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets, and subsets can be returned in any order.
Example
Input: [1,2,3]
Output: [[],[1],[2],[3],[1,2],[1,3],[2,3],[1,2,3]] (any order)
Constraints
0 <= len(nums) <= 20
All nums[i] are distinct.
Example
Input
1 2 3
Output
8