Subsets using bit manipulation

How will i sort the result in lexicographic order

hi @shivamm2110 u can store the ans in a set then print