Skip to content

Commit

Permalink
Apply code review
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras committed Jan 10, 2024
1 parent 9112b97 commit 721f401
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions exercises/practice/square-root/.meta/example.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

(provide square-root)

(define (square-root radicand)
(for/first ([num (in-naturals)]
#:when (equal? (expt num 2) radicand))
num))
(define/contract (square-root radicand)
(-> exact-positive-integer? (or/c exact-positive-integer?
false?))
(for/first ([num (in-inclusive-range 1 radicand)]
#:when (equal? (expt num 2) radicand))
num))

0 comments on commit 721f401

Please sign in to comment.