This is my code. I referred to the solution posted in
I am getting the error timelimit exceeded, command terminated with signal 15.
Please Help
This is my code. I referred to the solution posted in
I am getting the error timelimit exceeded, command terminated with signal 15.
Please Help
hello @manisini.chakraborty i am going through you code please give me sometime .
i will let you know about this.
But what is wrong with my code? The code runs perfectly in my compiler as well. Even the logical implementation of your code and my code is same. The only difference is I have created a class solution and i am using a class method to solve the question. There is no scene of infinite loop. So where is my code wrong?
@manisini.chakraborty your code is giving correct output for all the test cases .
but i have changed your code without class because it was taking a lot of time for executing for all the test cases as the constraints are vary large and also in your class there are vectors which are way more slower than arrays .
that why you were not able to submit your code and eventually end up by tle .
sometimes your code is correct but keeping in mind about the constraints you have to use proper data structure .
i have written your code only in the modified version .its not my code .
i hope you have understood the difference .
@manisini.chakraborty but still if you want to solve this question with the help of class only then also i have correted your code .
i hope i have cleared your doubt .
Happy Learning !!
Okay, thank you for your help.
Thank you so much, this code passed all test cases.