find subsets
void subsetsUtil(vector<int>& A, vector<vector<int> >& res,
vector<int>& subset, size_t index)
{
res.push_back(subset);
for (size_t i = index; i < A.size(); i++) {
subset.push_back(A[i]);
subsetsUtil(A, res, subset, i + 1);
// backtracking.
subset.pop_back();
}
return;
}
subsetsUtil(A, res, subset, 0);