소스 검색

Adding solution for 3065

Vinicius Teshima 1 개월 전
부모
커밋
bd251e9962
1개의 변경된 파일20개의 추가작업 그리고 0개의 파일을 삭제
  1. 20 0
      Racket/3065.rkt

+ 20 - 0
Racket/3065.rkt

@@ -0,0 +1,20 @@
+#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)