Monday, May 30, 2011

Last Element -1 of a List

nElm::[Int]->Int
nElm [x]=x
nElm (x:xs) = reverse xs !! 1

No comments:

Post a Comment