不写两个汉字貌似容易被CU识别为advertising... that's why i am here...
-
class Solution {
-
public:
-
vector<vector<int> > subsetsWithDup(vector<int> &S) {
-
vector<vector<int> > re;
-
if(S.empty()) return re;
-
vector<int> tmp;
-
re.push_back(tmp);
-
sort(S.begin(),S.end());
-
for(int i=0;i<S.size();i++)
-
{
-
int size=re.size();
-
for(int j=0;j<size;j++)
-
{
-
tmp=re[j];
-
tmp.push_back(S[i]);
-
if(re.end()==find(re.begin(),re.end(),tmp)) re.push_back(tmp);
-
}
-
}
-
return re;
-
}
-
};
阅读(144) | 评论(0) | 转发(0) |