in reply to How to Group List Items?
For instance, you want each group to have the same number of items and you only want max 6 groups. If you only have 1 group containing all items, that would satisfy the requirements, but you probably don't want that :-)
You also don't specify if you want to allow the same number to be in more than one group, though it looks like you don't, from your example.
Update: you also in other words: you don't specify how you want to score the returned groups. For instance, why don't you prefer (pseudocode):
[ [1 1 1 2 3], [4 4 4 5 5], [6 6 6 7 7], [8 8 8] ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to Group List Items?
by Thelonious (Scribe) on Jul 26, 2007 at 20:13 UTC | |
by waswas-fng (Curate) on Jul 26, 2007 at 21:18 UTC | |
by ysth (Canon) on Jul 27, 2007 at 01:45 UTC |