Algorithm for condensing/consolidating number combinations
- by user1404383
Using a horse race betting scenario, say I have a number of separate bets for predicting the first 4 finishers of the race (superfecta).
The bets are as follows...
1/2/3/4
1/2/3/5
1/2/4/3
1/2/4/5
1/2/5/3
1/2/5/4
What I want to do is combine or condense these separate combinations as much as possible. For the bets above, they can be all condensed into 1 line...
1/2/3,4,5/3,4,5
What would algorithm look like for this?