LC633 - Sum of Square Numbers
Problem
Given a non-negative integer c
, decide whether there're two integers a
and b
such that a2 + b2 = c
.
Example
Input: c = 5
Output: true
Explanation: 1 * 1 + 2 * 2 = 5
Solution
Use Fermat's theorem for Time Complexity.
Basic
Faster
Last updated