Mine
public text v1 · immutable-- Write a function, lastButOne, that returns the element before the last.
lastButOne :: [a] -> [a]
lastButOne xs = if null xs
then xs
else head (drop ((length xs) - 2) xs)
-- Write a function, lastButOne, that returns the element before the last.
lastButOne :: [a] -> [a]
lastButOne xs = if null xs
then xs
else head (drop ((length xs) - 2) xs)