4 ms·
This also comes easy, if you are using a more expressive language: remove e [] = [] remove e (e:xs) = xs remove e (x:xs) = x : remove e xs This even
by thomasahle 10y ago
This also comes easy, if you are using a more expressive language:
remove e [] = []
remove e (e:xs) = xs
remove e (x:xs) = x : remove e xs
This even has the benefit of making it very clear whether you've remembered the case where 'x' is not in the list.
- deleted 10y ago[deleted]