SA
Size: a a a
SA
SA
YK
YK
YK
SA
SA
AE
AE
AE
AE
AE
MK
AE
O
((1 2 3)
(2 3 4)
(3 4 5)
(4 5 6))
(1 2 3 4 5 6)
SA
YK
PG
(define (goal xs)
(match xs
((x1 x2 x3 . xs)
(let go ((x1 x1)
(x2 x2)
(x3 x3)
(xs xs)
(acc '()))
(let ((new-acc (cons (list x1 x2 x3) acc)))
(if (null? xs)
new-acc
(go x2 x3 (car xs) (cdr xs) new-acc)))))
(xs
xs)))