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?
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?
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.