Hello please complete and run the following question using t
Hello, please complete and run the following question using the Dr.Racket program.
Implement a Scheme function, pair2, that takes two lists L and M. and returns a list in which each element is a pair of corresponding elements. However, the two lists are not required to have the same length. If the length of one is shorter than the other, then the length of the resulting list is the same as the length of the shorter list. If one of the lists is empty list, return an empty list. For example,Solution
(define (union a b) (cond ((null? b) a) ((element? (car b) a) (union a (cdr b))) (#t (union (cons (car b) a) (cdr b))))) (define (pair2 a b) (list (union a b)))