Prime Checker - aloalgo

Prime Checker

Easy

You are given a single integer n.

Your task is to determine if the given integer n is a prime number.

Note that:

  • A prime number is defined as a natural number greater than 1.
  • A prime number has exactly two distinct positive divisors: 1 and itself.
  • Numbers less than or equal to 1 are not considered prime.

Return true if n is a prime number, and false otherwise.

Example 1

Input
2
Output
True
Explanation:

2 is a prime number.

Example 2

Input
10
Output
False
Explanation:

10 is divisible by 2 and 5.

Example 3

Input
1
Output
False
Explanation:

1 is not a prime number by definition.

Loading...
Input
2
Output
True

Hello! I am your ✨ AI assistant. I can provide you hints, explanations, give feedback on your code, and more. Just ask me anything related to the problem you're working on!