Tap here to switch tabs
Problem
Submissions

Problem: Sum of Square Numbers

Sum of Square Numbers asks whether a nonnegative integer can be written as the sum of two integer squares, where either integer may be zero. Return true or false.

Statement

Given a non negative integer c, determine whether there exist integers a and b such that a2+b2=ca^2 + b^2 = c. Return true if such integers exist, otherwise return false.

Note: a and b are allowed to be 00.

Constraints:

  • 0≤0 \leq c ≤231−1\leq 2^{31} - 1

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Square Numbers

Sum of Square Numbers asks whether a nonnegative integer can be written as the sum of two integer squares, where either integer may be zero. Return true or false.

Statement

Given a non negative integer c, determine whether there exist integers a and b such that a2+b2=ca^2 + b^2 = c. Return true if such integers exist, otherwise return false.

Note: a and b are allowed to be 00.

Constraints:

  • 0≤0 \leq c ≤231−1\leq 2^{31} - 1