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
▲ Console
📱

Install Talent Enrich

Get instant access to jobs and career tools on your device.