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

範例測試案例

範例 1

輸入:
2
預期輸出:
True

範例 2

輸入:
7
預期輸出:
True

範例 3

輸入:
10
預期輸出:
False

快捷鍵:

  • Ctrl/Cmd + Enter 提交

📈 統計

提交次數
0
通過次數
0