Math Fundamentals18 sections · 814 units
Open in Course

Problem - Valid Perfect Square

LeetCode 367

Given a positive integer numnum, return true if numnum is a perfect square, otherwise return false.

For example, num=16num = 16 returns true (because 42=164^2 = 16), but num=14num = 14 returns false.

The catch: you cannot use built-in square root functions. How would you check this without calling sqrt?