I have checked it for a number of custom inputs and I am unable to find my mistake that why it is not able to clear two test cases.
Unable to find my mistake
Plz send your code by saving on ide, so that we could check your error
Your code lacks the condition, when the value of n==1, or n==2, then you should have answer to be -1, since they do not have any pythagorean triplets,and also there is no need of line 13, and 19 in your code as code will work without these conditions too. Try to modify your code little bit
I have checked the triangle condition. For 1 and 2 please check the output by using custom input. It will give correct answer because these could not be the sides of triangle.
You can refer to this solution for your understanding, there is no need to check for equality condition