Why so many problems will suffer from TLE afrer a few months?


  • 0
    C
    public boolean canJump(int[] nums) {
    	int lastPos = nums.length - 1;
    	for (int i = nums.length - 1; i >= 0; i--) {
    		if (i + nums[i] >= lastPos) {
    			lastPos = i;
    		}
    	}
    	return lastPos == 0;
    }

  • 0
    C

    This solve passed OJ few months ago,now it's TLE. I have met this problem on many other problems and feel really bad on this. I need some courage.Crying...........


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.