Reputation: 579
Let's say I have a set with the following values: A, B, C, D. Is there an easy way of getting a set that contains AB, AC, AD, BC, BD, CD?
In Ruby, I can do this directly with the combination function. Any suggestions on how to do this in Java?
Upvotes: 2
Views: 357
Reputation: 31012
It's not built in to the language or standard libraries, so you'd have to code something up along the lines of this example.
Upvotes: 2