Valid Perfect Square
Easy
Math
Math
Binary Search
Return true if num is a perfect square without using sqrt.
Constraints
1 ≤ num ≤ 2^31-1
Examples
Example 1:
Input: 16
Output: true
Example 2:
Input: 14
Output: false
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console