Problem
Given a positive integer num, return true if it is a perfect square (some whole number times itself) and false otherwise. Do not use a built-in square-root or power function.
Example 1
- Input
- num = 16
- Output
- true
- Why
- 4 * 4
Example 2
- Input
- num = 14
- Output
- false
Example 3
- Input
- num = 1
- Output
- true
Constraints
1 <= num <= 2^31 - 1