Skip to content

15.3 Insert Interval Time Limit Exceeded #53

Open
@ByzanTine

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions