TLE - Even in Optimised Solution - JAVA - check for debugging lines
30

Hi,
Since I came across this behavior, just sharing since if some one also faces the issue , this will be useful.
In some problems eg : https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed/
If you get TLE even for an optimised/proper solution , please check if you are putting System.out.println() for debugging purpose .
If it is present it is affecting the run time .
Just remove it and run it again , if the solution is optimised it should pass after removing the debugging lines .

Thanks !

Comments (0)