Sum of Square Numbers
Given a non-negative integer c, decide whether there are two integers a and b such that a^2 + b^2 = c. Return true if such integers exist, otherwise return false.
Example 1
Input
c = 5Output
true1 * 1 + 2 * 2 = 5, so integers a = 1 and b = 2 satisfy the equation.
Example 2
Input
c = 3Output
falseThere are no two integers whose squared sum equals 3.
Constraints
- 0 <= c <= 2^31 - 1