Medium

Quiz

#633 Sum of Square Numbers

APPROACH

Given a non-negative integer c, determine whether two non-negative integers a and b exist such that a² + b² = c. Return true if so, otherwise false.

Example 1:

Input: c = 5
Output: true
Explanation: 1 * 1 + 2 * 2 = 5

Example 2:

Input: c = 3
Output: false
1 of 4
1:00

What is the optimal approach for this problem?