Skip to content

Instantly share code, notes, and snippets.

@bkb181
Last active June 12, 2020 16:58
Show Gist options
  • Save bkb181/aef13098af048b7170e3c6b3a5d4e31a to your computer and use it in GitHub Desktop.
Save bkb181/aef13098af048b7170e3c6b3a5d4e31a to your computer and use it in GitHub Desktop.
void all_subset(vector<int> a) 
{
int n=a.size(), c=0, i;
int total = pow(2, n); 
for(c= 0; c< total; c++) 
for(i= 0; i< n; i++) 
{
if(c&(1<< i)) 
cout << a[i]; 
cout << endl; 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment