| 1234567891011121314151617181920 |
- #lang racket
- (define/contract (min-operations nums k)
- (-> (listof exact-integer?) exact-integer? exact-integer?)
- (length (filter (lambda (x) (< x k)) nums))
- )
- (define (main)
- (define (r l k e)
- (printf
- "(min-operations ~a ~a) = ~a | Exp: ~a\n"
- l k (min-operations l k) e
- )
- )
- (r '(2 11 10 1 3) 10 3)
- (r '(1 1 2 4 9) 1 0)
- (r '(1 1 2 4 9) 9 4)
- )
- (main)
|