my code works properly for given test cases but when submitted it gives runtime error (NZEC)
Please put the link to your solution in the post body (where we can click on it) instead of the title (where we can’t)
Consider the test input:
1 LLUDLLUD 1 2 2 2 3 1 -2
https://www.codechef.com/viewsolution/37025596 . your test case helped me to solve the issue but now my code gives TLE the time complexity is O(S + Q) where s is the length of the string and q is the number of queries. can you please help me with this too.
The time limits for this question are very tight, so you need a very well-optimised solution. That means:
- Very fast input and output
- Probably not using a
Global variables strike again
2 RLUDRLUD 1 2 2 2 3 1 -2 RLUDRLUD 1 2 2 2 3 1 -2
Hhahaaaahahah. Lemme Write str.clear() before taking the input. To be honest, this is only the second time im using globals xD . Thanks for the insight man <3 .
i dont need to work on my logic right.
I can’t immediately see anything wrong with the logic.
codechef.com/viewsolution/37027257. I have made the suggested changes in my code but is still gives me tle
No idea then
Some of the AC Java solutions are using