; your code goes here
(define (same-parity x xs)
(define parity (remainder x 2))
(define (iter xs acc)
(if (null? xs)
(reverse acc)
(if (= (remainder (car xs) 2) parity)
(iter (cdr xs) (cons (car xs) acc))
(iter (cdr xs) acc))))
(iter xs '()))
(define xs (list 1 2 3 4 5 6 7 8 9 10))
(display (same-parity 1 xs))
(newline)
(display (same-parity 2 xs))
(newline)
OyB5b3VyIGNvZGUgZ29lcyBoZXJlCihkZWZpbmUgKHNhbWUtcGFyaXR5IHggeHMpCiAgKGRlZmluZSBwYXJpdHkgKHJlbWFpbmRlciB4IDIpKQogIChkZWZpbmUgKGl0ZXIgeHMgYWNjKQogICAgKGlmIChudWxsPyB4cykKICAgICAgICAocmV2ZXJzZSBhY2MpCiAgICAgICAgKGlmICg9IChyZW1haW5kZXIgKGNhciB4cykgMikgcGFyaXR5KQogICAgICAgICAgICAoaXRlciAoY2RyIHhzKSAoY29ucyAoY2FyIHhzKSBhY2MpKQogICAgICAgICAgICAoaXRlciAoY2RyIHhzKSBhY2MpKSkpCiAgKGl0ZXIgeHMgJygpKSkKCihkZWZpbmUgeHMgKGxpc3QgMSAyIDMgNCA1IDYgNyA4IDkgMTApKQoKKGRpc3BsYXkgKHNhbWUtcGFyaXR5IDEgeHMpKQoobmV3bGluZSkKKGRpc3BsYXkgKHNhbWUtcGFyaXR5IDIgeHMpKQoobmV3bGluZSk=