Pythagorein triplate problem

i did not understand the solution of this question but
my code give correct output but got 40 only
and it tell me to solve with efficient manner

@dkroy8790
The most efficient way to code solution of this problem is to solve the equation for Pythagoras and you’ll get solution for odd and even number which is:
if x is odd:
(x*x-1)/2, (x*x+1)/2
if x is even:
(x*x)/4)-1, ((x*x)/4)+1
Code:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.