Code Review

Compare your solutions

    #| BEGIN (Write your solution here) |#
(define (square a) (* a a))
(define (squaresum a b) (+ (square a) (square b)))

(define (solution a b c) (squaresum (max a b c) (max (min a b) (min a c) (min b c))))
#| END |#
    #| BEGIN (Write your solution here) |#
(define (square a) (* a a))
(define (squaresum a b) (+ (square a) (square b)))

(define (solution a b c) (cond ((and (> a b) (> b c)) (squaresum a b))
                               ((and (> c b) (> b a)) (squaresum c b))
                               ((and (> a c) (> b c)) (squaresum a c))
                               (else 0)))
#| END |#
    #| BEGIN (Write your solution here) |#
(define (square a) (* a a))
(define (squaresum a b) (+ (square a) (square b)))

(define (solution a b c) (squaresum (max a b c) (max (min a b) (min a c) (min b c))))
#| END |#
    #| BEGIN (Write your solution here) |#
(define (square a) (* a a))
(define (squaresum a b) (+ (square a) (square b)))

(define (solution a b c) (cond ((and (> a b) (> b c)) (squaresum a b))
                               ((and (> c b) (> b a)) (squaresum c b))
                               ((and (> a c) (> b c)) (squaresum a c))
                               (else 0)))
#| END |#