In [2]:
%classpath add mvn org.apache.commons commons-math3 3.6.1
In [3]:
import org.apache.commons.math3.util.Combinations
import scala.collection.JavaConverters._
Out[3]:
In [4]:
val it = new Combinations(6, 2).iterator()
it.foreach(System.out.println)
In [5]:
val it = new Combinations(5, 3).iterator()
while(it.hasNext()){
System.out.print(it.next().mkString(" ") + "\n")
}
Out[5]:
In [ ]: