leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

15.3 Insert Interval Time Limit Exceeded

Open ByzanTine opened this issue 10 years ago • 1 comments

Hi, I gotta to run your solution on github. However, I got a TLE when submit to online judge. The corresponding testcase is something like [[1,2],[3,4],[5,6],[7,8],[9,10],[11,12],[13,14],[15,16],[17,18] ... [19999,20000]], [0,20001]] It cause multiple erase which make your algorithm in worst case O(n^2). A O(n) time, O(n) space solution that use extra memory to save the result can basically pass the oj.

ByzanTine avatar Feb 17 '15 04:02 ByzanTine

Just found out dupe with #51, sorry about that.

ByzanTine avatar Feb 17 '15 04:02 ByzanTine