0

Is there a way I can pick all n-combinations from a list

Suppose my list is [1,2,3] is there a way I can get the result as

[ [1] , [2] , [3] , [1,2] , [2,3] , [1,3] , [1,2,3] ]

p.s I don's want both [1,2] and [2,1] to be returned.

I'm sorry if the question is framed poorly

sacuL
  • 49,704
  • 8
  • 81
  • 106
NePtUnE
  • 889
  • 1
  • 7
  • 10
  • 1
    hi this has already been asked and answered https://stackoverflow.com/a/5898031/4508178 – Derte Trdelnik May 09 '20 at 15:36
  • 1
    Does this answer your question? [How to get all possible combinations of a list’s elements?](https://stackoverflow.com/questions/464864/how-to-get-all-possible-combinations-of-a-list-s-elements) – JakuJ May 09 '20 at 15:37

0 Answers0