https://hack.codingblocks.com/contests/c/512/513
https://ide.codingblocks.com/s/52845
my order of output is not correct. how to make it in correct order??
https://hack.codingblocks.com/contests/c/512/513
https://ide.codingblocks.com/s/52845
my order of output is not correct. how to make it in correct order??
you can store all the subsets in a 2D vector and sort every vector using sort(v.begin(),v.end()) and then print it
@ayush9999723922
another approach would be to use set container in STL, insert the subsets in set and then just print them.
Hit like if you get it.
Cheers
HappyCoding 
plz check the code…
your code is correct bt you are not printing in correct order.
For
Input
3
3 2 1
3
Your output
3 and 2 1
Required Output
1 2 and 3