Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- one xs = xs !! (length xs - 2)
- two xs = reverse xs !! 1
- three = aux
- where
- aux [x,y] = x
- aux (x:xs) = aux xs
- four xs = aux xs (length xs)
- where
- aux xs 2 = head xs
- aux (x:xs) l = aux xs (l - 1)
- five xs = snd . head . filter (\(x, _) -> x == 1) $ zip (reverse xs) [0 ..]
- six = head . tail . reverse
- seven = last . init
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement