Easy · Math

Prime Number

Given an integer n, return true if n is a prime number (an integer greater than 1 whose only positive divisors are 1 and itself), and false otherwise.

Examples

Example 1

n = 29

Output: 29 is prime

Example 2

n = 91

Output: 91 is not prime

Rebuild it in the studio

Core interview problems are free with a full runner and lessons; Pro opens the complete library.

More Math problems