Advertisement
PonaFly

Untitled

Mar 21st, 2019
887
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.35 KB | None | 0 0
  1. (define (Solution1 tree)
  2. (if (empty? tree) #f
  3. (if (or (and (not (empty? (cadr tree))) (not (zero? (car (cadr tree))))(= (remainder (car tree) (car (cadr tree))) 0)) (and (not (empty? (caddr tree) )) (not (zero? (car (caddr tree)))) (= (remainder (car tree) (car (caddr tree))) 0))) (car tree)
  4. (or (Solution1 (cadr tree)) (Solution1 (caddr tree))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement