Search
⌘K
Get Premium
Leetcode 633. Sum of Square Numbers
Determine whether a non-negative integer c can be expressed as a^2 + b^2 for integers a and b. With c up to 2^31−1, the typical approach is O(sqrt(c)) — e.g., iterate a up to sqrt(c) and check whether c−a^2 is a perfect square (or use a two-pointer search).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.