Search
⌘K

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.

Comments

Your account is free and you can post anonymously if you choose.