S
Savvoulidis Iordanis
I' m on an app about football bets, and I want to analyze all the
possible combinations of the player's input as if they where
made separately. I explain below:
Let's say we have 4 matches to bet on, A,B,C and D, with the
following expected results (bets) filled by the player in
an 4 x 2 array (or better a M x N array):
{ {"1" , ""} , {"X" , "2"} , {"1" , "2"} , {"X" , ""} }
A. 1
B. X or 2
C. 1 or 2
D. X
After the analysis, the above should spread as 4 possible columns :
A. 1 1 1 1
B. X 2 X 2
C. 1 1 2 2
D. X X X X
Using recursion, how can I create all the possible combinations as a (~)
separated string ?
Of course if there is any solution without recursion, it' s welcome
PS. Smart code is expected (with a few comments on what it does)...
TIA
possible combinations of the player's input as if they where
made separately. I explain below:
Let's say we have 4 matches to bet on, A,B,C and D, with the
following expected results (bets) filled by the player in
an 4 x 2 array (or better a M x N array):
{ {"1" , ""} , {"X" , "2"} , {"1" , "2"} , {"X" , ""} }
A. 1
B. X or 2
C. 1 or 2
D. X
After the analysis, the above should spread as 4 possible columns :
A. 1 1 1 1
B. X 2 X 2
C. 1 1 2 2
D. X X X X
Using recursion, how can I create all the possible combinations as a (~)
separated string ?
Of course if there is any solution without recursion, it' s welcome
PS. Smart code is expected (with a few comments on what it does)...
TIA