hi could anyone help me with this question? Write a function that will take a list of pairs and return just the pair comprising the first element of the first pair and the second element of the last pair. Eg. > (reduce-pairs ’()) NIL > (reduce-pairs ’((1 2) (3 4))) (1 4) > (reduce-pairs ’((1 2) (3 4) (5 6))) (1 6)
I have got this so far (define reduce-pair(λ(x y)(cond ((pair? x)x) (cons( car x) (cons ( list-tail (second y))))))) but its completely wrong thanks in advance -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.