Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (all n lst)
- (if (= n 0) '(())
- (if (< n 0) '()
- (apply append (map (lambda (x) (map (lambda (y) (cons x y) ) (all (- n x) lst ) ) ) lst ) )
- )
- )
- )
- (all 3 '(1 2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement