Given a positive integer num, return true if num is a perfect square or false otherwise.
A perfect square is an integer that is the square of an integer; in other words, it is the product of some integer with itself.
You must not use any built-in library function, such as sqrt.
Example 1:
Input: num = 16 Output: true Explanation: 4 * 4 = 16
Example 2:
Input: num = 14 Output: false
Constraints:
1 <= num <= 231 - 1