I m struggling with my code !!i had done dry run still not getting where the issue is and compared with other code too, but don't Know where the error is !! Here is my code :
vector<string> powerSer(string s,vector<string> &ans,int i)
{
if(i==s.size())
return ans;
string op="";
op.push_back(s[i]);
ans.push_back(op);
// cout<<ans[0];
powerSer(s,ans,i+1);
ans.pop_back();
powerSer(s,ans,i+1);
return ans;
}
vector <string> powerSet(string s)
{
//Your code here
vector<string> ans;
ans= powerSer(s,ans,0);
return ans;
}
I m not getting any output can anyone help me with that!
Aucun commentaire:
Enregistrer un commentaire