FunctionRacerProblemsRace

Is Prime

BeginnerMathPython, JavaScript, TypeScript, Java, C++

Return True if n is a prime number (a whole number above 1 whose only divisors are 1 and itself), otherwise False.

Example 1

n 13
returns true

Only 1 and 13 divide it.

Example 2

n 15
returns false

Divisible by 3 and 5.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems