Testcase not passing with this pythogorous triplet?
hi @pranjalsoni i see your latest submission passed all the test cases. Do you still have any queries?
yes, but the link of code, I gave not passing all test cases why??
@pranjalsoni one of the codes is doing extensive calculations and using unnecessary operations, which lead to the answer being compressed by the compiler for really large inputs.
For eg for the input 99999979 the answer should be 4999997900000220 4999997900000221 but this code gives output as 4999997900000220 5e+15
Thank you ishita ji, but how do I find that what compiler thinks and how I distinguish between them.
@pranjalsoni you should always try your best to make sure that the number doesnt get too big while doing operations like addition, multiplication etc and try to keep the number as small as possible at all times. You can change the order of calculations with the help of () or simplify the expressions if possible. If number gets too big there is also a possibility of the condition of integer overflow which will result in runtime error and these type of errors are really hard to catch.
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.