What's wrong in my recursion function


#1

Comment body goes here.

void solve(vector &ip, vector<vector> &op){
if(ip.size()==0){
op.push_back(ip);
return;
}

vector<vector<int>> op1 = op;
vector<vector<int>> op2 =op;
//op1.push_back( );
op1.push_back(ip[0]);
ip.erase(ip.begin()+0);

solve(ip, op1);
solve(ip, op2);
return ;

}

vector<vector > Solution::subsets(vector &A) {

int n = A.size();
sort(A.begin(), A.end());
reverse(A.begin(), A.end());
vector<vector<int>> op;

solve(A, op);
return op;

}