Tuesday, October 6, 2009

P06: Is a list palindrome

scala> val plist = List(1, 2, 3, 2, 1)
res19: List[Int] = List(1, 2, 3, 2, 1)

scala> plist == plist.reverse
res20: Boolean = true

No comments:

Post a Comment

Sociable