Getting wrong answer and tle

Here i have implemented the logic discussed in the video…
This is my code…


It is showing right output given test case… But while submitting the code it is showing wrong answer and tle.
Please have a look at this.
Thanks

hey @ashishnnnnn i have seen your code and can see that you got the implementation but aren’t able to code and you are also not considering side cases also. See this is my personalized code https://ide.codingblocks.com/s/342971 i have tried to keep it clean and have also added few comments for your better understanding. Take this code for referral :smile:

Could you show be some input… where my code is performing wrong.

I guess you are dealing with float values, and in this question they are dealing only with integer values, if you will send int values instead of float. It might gets accepted :slight_smile:

Yes… That’s the reason… :slight_smile: Now it got accepted…