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. A perfect square is an integer that equals k2k^2 for some integer kk.

For example, 1616 is a perfect square because 16=4216 = 4^2. But 1414 is not.

This problem combines algebra and binary search. Think about what equation you're solving.