Skip to content

Instantly share code, notes, and snippets.

@kretes
Created April 16, 2014 16:20
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 kretes/10901900 to your computer and use it in GitHub Desktop.
Save kretes/10901900 to your computer and use it in GitHub Desktop.
def isPalindrome[T](ts: Seq[T]): Boolean = ts.zip(ts.reverse).map((pair) => pair._1 == pair._2).contains(false) == false
// def isPalindrome[T](ts: Seq[T]): Boolean = ts.reverse.eq(ts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment