Created
July 19, 2016 07:13
-
-
Save pavlov99/be6000fe6a1bb5da287fd3c09eaa7f0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def combine[T](s: Seq[T]): Seq[Seq[T]] = | |
for { | |
len <- 1 to s.length | |
combinations <- s combinations len | |
} yield combinations | |
println(combine(List('a', 'b', 'c'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment