Remove multiple characters from a list if they are next to each other in Scheme
I have to make a Dr. Racket program that removes letters from a list if they are following the same letter as itself. For example: (z z f a b b d d) would become (z f a b d). I have written code for this but all it does is remove the first letter from the list. Can anyone help? #lang racket (define (remove-duplicates x) (cond ((null? x) '()) ((member (car x) (cons(car(cdr x)) '()))) (remove-duplicates (cdr x)) (else (cons (car x) (remove-duplicates (cdr x)))))) (define x '( b c c d d a a)) (remove-duplicates x) (define (remove-dups x) (cond [(empty? x) '()] [(empty? (cdr x)) (list (car x))] [