717. Check if a Number is Odd or NotPOTD
Given a non-negative integer n, determine whether it is odd.
Return true if the number is odd, otherwise return false.
A number is odd if it is not divisible by 2 (i.e., n % 2 != 0).
Example 1:
Input: n = 7
Output: true
Explanation: 7 is not divisible by 2. Hence, it is odd.
Example 2:
Input: n = 0
Output: false
Explanation: 0 is divisible by 2. Hence, it is not odd.
Now Your Turn!
Pick the correct output for the given inputInput: n = 10000
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 0 <= n <= 104