Hi,

I've got a problem which has left me scratching my head for the better part of a week. What I need to do is take x amount of items on one side, and somehow find all the combinations of y that fit in x. Now I know this doesn't make much sense but it is very hard to explain, so I'm probably better off giving an example.

In this example just say I have three isntances of x; A, B and C. x can grow to as much as 5 or 6 (D, E, F).

On the flipside I have two instances of y; [1] and [2]

I need to find how many combinations there are where y can fit in x.

The outcome, if working properly, should be...

A [1][2] B        C
A        B [1][2] C
A        B        C [1][2]
A [1]    B [2]    C
A        B [1]    C [2]
A [1]    B        C [2]
A [2]    B [1]    C
A [2]    C        C [1]
A        B [2]    C [1]

Does anyone have any ideas on how I could do this? As I said I'm completely stumped.

Thanks,
Michael.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to