Skip to content

Instantly share code, notes, and snippets.

@dchrusciak
Last active December 25, 2015 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dchrusciak/7011405 to your computer and use it in GitHub Desktop.
Save dchrusciak/7011405 to your computer and use it in GitHub Desktop.
object S99_P14 {
def duplicate[T](as: Seq[T]): Seq[T] =
as.foldLeft(Seq[T]())((r, c) => r ++ Seq.fill(2)(c))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment