Given an integer n, write a function that returns True if n is a prime number and False otherwise. A prime number is greater than 1 and has exactly two positive divisors: 1 and itself.
Constraints
-10^9 <= n <= 10^9
The function should correctly handle negative numbers, 0, and 1
Aim for better than O(n) time by limiting divisor checks
Function Signature
defis_prime(n):
Interviewer
Whenever you're ready, walk me through your approach or go straight to the code. The requirements are in the Question tab.