There is an array:

How to get all possible combinations of rearranging the elements in some places?

`$arr = [0, 0, 0, 1, 1, 1]`

How to get all possible combinations of rearranging the elements in some places?

asked June 14th 19 at 18:57

2 answers

answered on June 14th 19 at 18:59

answered on June 14th 19 at 19:01

For example, the algorithm Narayana Pandita, which at each iteration two elements varies between places. Implementation in JavaScript for example.

In your problem, given that it is not arbitrary arrays of strings, and bits, faster, probably in succession to cycle through the numbers 0 to 63 and count the bits included.

In your problem, given that it is not arbitrary arrays of strings, and bits, faster, probably in succession to cycle through the numbers 0 to 63 and count the bits included.

Find more questions by tags PHP