Midway91 / HactoberFest2023

This is for HacktoberFest2023
135 stars 1.82k forks source link

Create Power Set in Lexicographic order.cpp #1278

Closed ShuvamBag closed 11 months ago

ShuvamBag commented 11 months ago

The idea is to sort array first. After sorting, one by one fix characters and recursively generates all subsets starting from them. After every recursive call, we remove last character so that next permutation can be generated.