Prime Number Check

Easy
math algorithm

Prime Number Check

Determine whether a given number is prime.

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.

Example 1

Input: 7

Output: True

Example 2

Input: 10

Output: False

Constraints

  • 2 ≤ n ≤ 10000

Sample Test Cases

Example 1

Input:
2
Expected Output:
True

Example 2

Input:
7
Expected Output:
True

Example 3

Input:
10
Expected Output:
False

Keyboard shortcuts:

  • Ctrl/Cmd + Enter to submit

📈 Statistics

Submissions
0
Accepted
0