|
-
January 6th, 2004, 06:37 PM
#16
You could std::sort and run std::unique on the elements before getting the combinations.
That is actually too restrictive. In my example (3 of "ABBCCCDD"), using std::unique and your code would only provide 4 values:
B C D
A C D
A B D
A B C
and is missing values such as:
A B B
C C C
B B D
B D D
(and there are six others)
- Kevin
P.S. Don't get me wrong. I think your code is great.... I've kept it around b/c it is very useful. It just isn't meeting my needs for one particular problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|