I am trying to generate an array of all combinations of an array, but how can I generate without repeating.
My first solution was just remove the repeating elements using some for
, but I am dealing with big arrays, with 50 length size or more and the execution never end.
ex: (0,0,1,0)
[1,0,0,0]
[0,1,0,0]
[0,0,1,0]
[0,0,0,1]