sicp-solutions/ex-2.19.scm
Petar Kapriš da96368e0b Add solutions to exercises from subsection 2.2.1
In exercise 2.17, there is an error with the test on hexlets site, which
should be reported to them.
2025-02-06 11:08:54 +01:00

14 lines
464 B
Scheme

#lang sicp
(define (first-denomination coin-values)
(car coin-values))
(define (except-first-denomination coin-values)
(cdr coin-values))
(define (no-more? coin-values)
(null? coin-values))
; The answer will not be affected by the order of the list. We
; are still dividing cases into "doesn't use the first coin"
; and "uses at least one instance of first coin". However I
; suspect it will impact the performace, although I haven't
; formally proven it.