Skip to content

Instantly share code, notes, and snippets.

@bartoszm
Created October 12, 2013 10:11
Show Gist options
  • Save bartoszm/6948281 to your computer and use it in GitHub Desktop.
Save bartoszm/6948281 to your computer and use it in GitHub Desktop.
object S99_P12 {
def decode[T](its: Seq[(Int, T)]): Seq[T] = {
its.foldLeft(List[T]()) { (l, e) => l ++ List.fill(e._1)(e._2) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment