trekhleb / javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
MIT License
185.13k stars 29.86k forks source link

Adding a simple cascading solution to generate a Power Set #975

Closed trekhleb closed 1 year ago

trekhleb commented 1 year ago

We already have Bitwise and BackTracking solutions.

However, the Cascading solution described in this PR might be easier to understand. It is just about two for loops, with no recursion.