Skip to content

Latest commit

 

History

History

simple-nearest-prime

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

In this Kata, you will be given a number and your task will be to return the nearest prime number.

solve(4) = 3. The nearest primes are 3 and 5. If difference is equal, pick the lower one. 
solve(125) = 127

We'll be testing for numbers up to 1E10. 500 tests.

More examples in test cases.