Pythagorean triplet problem

Getting one test case wrong out of five .How can I make it correct.

@SarthakMittal share your code with help of ide link

@SarthakMittal check for 6 your o/p 6 10 while ans 8 10

thanks sir I got it right

@SarthakMittal you are welcome