120. create `isPrime()`

Is this helpful ?

from all members: - accepted / - tried

A Prime number is a natural number greater than 1 that is divisible only by itself and 1, such as 2,3,5....

You are asked to implement isPrime() to check if a number is prime.


What is the time cost of your implementation ? can you improve your approach to have the fewest comparisons?

Let's try to solve this problem within 10 mintues.