0
Can anyone please help me to optimize this code as, it is giving time limit exceeded error for large values.
It basically deals with array rotation. I know there are many methods to do so but pls do not give a new method as the answer. Just help me to optimize this code so that it can run for large values. https://code.sololearn.com/c15dAfJCO13Y/?ref=app
6 Respostas
+ 3
Because the SoloLearn playground is limited I would say to change playgrounds for the continued testing. But the code is valid and appears to be optimized as far as SoloLearn.
I was able to go outward 8 digits here as far as testing.
Best test was at 4 ...
+ 2
Your code is not throwing an error once I removed some space https://code.sololearn.com/cukiT0338BeF/?ref=app
+ 1
Yes. But it's still giving time limit error.
What can I do to execute it faster.
+ 1
Yes sir it is working here but not on other platforms like HackerRank, i.e in a similar question 8 out of 10 test cases are running and rest 2 are showing time limit exceeded error.
0
https://code.sololearn.com/cgwlrxV06Xer/?ref=app
Actually the problem was in the algo of my code. But I am sure this code will work in every possible case.
0
p.s this is the corrected code.