Your description isn't correct

When you say N=2mn implying N/2=mn then you have to search through the space of all ordered pairs mn which give N/2, whereas you said N/2=m and n=1 which is one of the cases, eg give your Input to your code N=16 and then try and figure out what are the values of m,n as far as your explanation is concerned you will pick (m,n)=(8,1) which wouldn’t give you the desired Pythagorean triple as the right Pythagorean triple comes with (m,n)=(4,2).
similarily you said N=(m-n)*(m+n) then N=m+n and 1=m-n this also is only true when N is a prime number not when N is composite in this case aswell you will have to search through the divisors of N.

I mean (8,1) will give you a triple (63,16,65) but will miss out on (12,16,20)

Yeah but question just asks you to find any triplet if it exists, no one is asking you to find all the triplets.
The triplet <12,16,20> is as correct as <12,16,20>

No it isn’t. One is a factor of every number irrespective of whether its prime or composite.
So we can write any number N as N*1.

So at N=16 i output (12,16,20) this will pass or will (63,16,65) pass

Both will pass the tesctase

can you please explain, why you have re-opened the doubt.

I haven’t reopened it i have just asked a question which you answered after it i didn’t click anything

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.