Code Review

Compare your solutions

    #| BEGIN (Введите свое решение) |#
(define (solution b n)
  (cond ((= n 0) 1)
        ((= n 1) b)
        (else (fast-expt b n 1))
  )

)

(define (even? n)
(= (remainder n 2) 0))

(define (fast-expt b n a)
  (cond ((= n 2) (* a b b))
        ((even? n) (fast-expt (* b b) (/ n 2) a))
        (else (fast-expt b (- n 1) b))
  )
)
#| END |#