Haskell Noob
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment