P26

ninetynine.P26
object P26

P26 - generate the combinations of k distinct objects chosen from the n elements of a list.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
P26.type

Members list

Value members

Concrete methods

def combinations[A](k: Int, l: List[A]): List[List[A]]

Iterate over the list and remove one element at a time. Do this k times recursivly and keep track on the elements that you take out. When you have recursed n times into it you need to iterate over everything that is left over.

Iterate over the list and remove one element at a time. Do this k times recursivly and keep track on the elements that you take out. When you have recursed n times into it you need to iterate over everything that is left over.

Attributes

Returns

the generated list of combinations

Concrete fields

val logger: Logger