Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Iterate over all possible pairs (a,b) and check that the square root of a * a + b * b is an integers less than or equal n
You can check that the square root of an integer is an integer using binary seach or a builtin function like sqrt