LeetCode 633, Medium. Topics: Math, Two Pointers, Binary Search. View on LeetCode.
Generate this problem as a practice environment: tested reference solution, 21 parametrized pytest cases, and a playground notebook:
Problem
Given a non-negative integer c, decide whether there’re two integers a and b such that a^2 + b^2 = c.
Examples
Constraints
Solution
Reference implementation from solution.py on GitHub, full suite in test_solution.py:
Complexity
NeetCode All. Last modified on September 7, 2026