InterviewBit Academy is now Scaler!
Learn Tech Skills from Scratch @ Scaler EDGE


Given a non negative integer A,
following code tries to find all pair of integers (a, b) such that

  • a and b are positive integers
  • a <= b, and
  • a2 + b2 = A.
  • 0 <= A <= 100000

However, the code has a small bug. Correct the bug and submit the code.

NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving MATH_BUG02 on Interview Code Editor
Sign Up
to access hints and editorial solutions for MATH_BUG02


Click here to start solving coding interview questions