You are given an integer n. Your task is to determine whether it is a prime number by checking divisibility only up to the square root of n.
A prime number is a positive integer greater than 1 that has exactly two distinct positive divisors: 1 and itself. Return Yes if n is prime; otherwise, return No.
Input: n = 29
Output: Yes
Explanation: No integer from 2 through √29 divides 29 evenly, so 29 is prime.
Input: n = 100
Output: No
Explanation: The number 100 is divisible by 2, so it has a divisor other than 1 and itself and is not prime.
Input: n = 1
Output: No
Explanation: The number 1 is not prime because it has only one positive divisor.
Sign in to write, run, and submit your solution against the full test suite.