Skip to content

Instantly share code, notes, and snippets.

@themexpride
Created December 16, 2022 06:50
Show Gist options
  • Save themexpride/815185dda32030f5a0acf5c511fe076a to your computer and use it in GitHub Desktop.
Save themexpride/815185dda32030f5a0acf5c511fe076a to your computer and use it in GitHub Desktop.
Scala. Recurison approach. Used List concatentation to concatenate two seperate lists.
def f(arr:List[Int]):List[Int] = {
arr match {
case Nil => Nil
case h::t => f(t):::h::Nil
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment