const PowerSet = array => array.reduce((accumalator, current) => accumalator.concat(accumalator.map(n => [current].concat(n))), [[]]);
      console.log(PowerSet([1,2]))
      

      Javascript language logo
      PowerSet of array numbers

      PowerSet of array numbers

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.