Skip to content

Instantly share code, notes, and snippets.

@nsfyn55
Created June 11, 2012 15:39
Show Gist options
  • Save nsfyn55/2910722 to your computer and use it in GitHub Desktop.
Save nsfyn55/2910722 to your computer and use it in GitHub Desktop.
Scala Palindrome Checker
object App{
def isPalindrome(s: String) = {
(for (x <- 0 to s.length/2) yield (s(x) == s(s.length - x - 1)))
.reduceLeft((acc,n)=> acc && n)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment