###### [leetcode]90. Subsets II
class Solution {
public:
vector<vector<int>> subsetsWithDup(vector<int>& nums) {
vector<int> cur;
vector<vector<int>> ret;
ret.push_back(cur);
vector<vector<int>> lastR;
vector<vector<int>>::iterator iter;

sort(nums.begin(),nums.end());//最重要的一步

for(int i=0;i<nums.size();i++)
{
lastR=ret;

for(int j=0;j<lastR.size();j++)
{
cur=lastR[j];
cur.push_back(nums[i]);
iter=find(lastR.begin(),lastR.end(),cur);

if (iter==lastR.end())
ret.push_back(cur);
}

}
return ret;
}
};

#### [LeetCode 90] Subsets II

2015-03-28 00:32:07

#### LeetCode90:Subsets II

2015-07-08 11:12:56

#### 90. Subsets II Leetcode Python

2015-01-15 06:03:55

#### LeetCode Subsets 和 LeetCode Subsets II

2014-04-09 22:02:48

#### 【LeetCode with Python】 Subsets II

2014-07-04 16:11:45

#### LeetCode 90 Subsets II--In C++

2016-06-04 16:01:54

#### Subsets II -- LeetCode

2014-04-28 04:23:53

#### LeetCode 90 SubsetsII (Python详解及实现)

2017-08-09 19:34:19

#### leetcode解题之 77. Combinations&78. Subsets&90. Subsets II java 版（求所有子集）

2017-04-08 19:36:52

#### LeetCode 90：Subsets II

2016-01-25 17:09:43

## 不良信息举报

[leetcode]90. Subsets II