Description: a subset of the solution set can not contain duplicate,
Example:
Input: nums=[1, 2, 3]
Output:
[3],
[1],
[2],
[1, 2, 3],
[1, 3],
[2, 3],
[1, 2],
[]
]
CodePudding user response:
The class Solution {Public:
Vector
Vector
Vector
Int start=0;
Backtrace (res, path, start, nums);
return res;
}
Void backtrace (vector
Res. The push_back (path);
For (int I=start; i
Backtrace (res, path, I + 1, nums);
Path. Pop_back ();
}
}
};
I put the back of the bottom fifth sentences into a backtrace (res, path, start + 1, nums); Why the result is not the same!