Tap here to switch tabs
Problem
Submissions

Problem: Sum of Square Numbers

med
30 min
Try to solve the Sum of Square Numbers problem.

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

med
30 min
Try to solve the Sum of Square Numbers problem.

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