I am using Intermediate Student with Lambda in DrRacket, I was wondering how one would remove the duplicates in a list, while keeping the order. For example (remo
(remo
This is the solution:
(define (remove-duplicates lon) (foldr (lambda (x y) (cons x (filter (lambda (z) (not (= x z))) y))) empty lon))