90 Subsets II
Last updated
Was this helpful?
Last updated
Was this helpful?
Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set).
Note: The solution set must not contain duplicate subsets.
For example,
Ifnums=[1,2,2]
, a solution is:
(1) Backtracking
Backtracking: 时间复杂度O(2^n), 空间复杂度O(2^n)