99-haskell-problems/Problems 11-20/problem_20.hs

6 lines
130 B
Haskell
Raw Normal View History

2024-05-24 18:50:16 -05:00
removeAt :: Int -> [a] -> (a, [a])
removeAt n ls = (last l, take m l ++ r)
where
(l, r) = splitAt n ls
m = length l - 1