This is my first attempt at Scheme & I seem to be stuck at the end of the line. This program is to take a list of numbers, two-subsets and pull numbers that equal the same sum. ie; 5 + 2 = 7 and 4 + 3 = 7. The program should print the two subsets {5 2} {4 3} I am receiving an error "else: not allowed as an expression" and I just can't seem to understand why. Any hints or direction is appreciated.
(define two-subsets (lambda (list count sum1 sum2)
(cond ((and (not (= count 0) (= sum1) (= sum2) #t)
((null? list) #f)
((two-subsets (cdr list) (+ count) (+ sum1) (+ sum2 (car list) #t)
((two-subsets (cdr list) (+ count 1) (- sum1) (- sum2 (car list) #t)
(else (two-subsets (cdr list) count sum1 sum2)))
))))