Timeline number of tasks


  • 0
    L

    Given an array of tasks with start time and end time, return how many timelines are needed to place all these tasks without any task overlap others in any timeline.

    Example:
    task list: [[10:00, 11:00],[10:15, 10:30],[11:00, 11:15]]

    [10:00, 11:00] : |------1------|
    [10:15, 10:30] : |--2---|
    [11:00, 11:15] : |--3--|

    The return is 2. Because you can arrange the 3 tasks in 2 lines:

    |------1------||--3--|
    |--2---|

    '''
    structure Task{
    time_t StartTime,
    time_t EndTime,
    };
    '''
    Input: vector<Task>
    Output: int


Log in to reply
 

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