0
I’m racking my brain to create a logic that will do the following:
Receive an array of N positions, within these positions define all possible possibilities without repeating the key of a position.
Example: Array('A','B','C')
To
AB
ABC
AC
CBA
B
BA
BAC
BC
BCA
C
CA
CAB
CB
CBA
Examples of the mathematical formula
When there are 3 positions:
3+(3*2)+(3*2*1)
When there are 4 positions:
4+(4*3)+(4*3*2)+(4*3*2*1)
I believe I could solve this using
n
for
, beingn
the amount of variables that will be used– MarceloBoni
A doubt, you have some control over the amount of variables that enter?
– MarceloBoni
Yes, you can enter 1 to 10 values and I can identify how many are.
– Paje
It is difficult to implement this... kkkkkkkk
– Pedro Laini