Competitive-Programming-and-Contests-VP-Solution

The repository that contains all solutions made for the course Competitive Programming and Contests by the University of Pisa

View the Project on GitHub

N meetings in one room

Solved Solution Time :clock11:
:heavy_check_mark: Greedy 0.55 s

Solution or Solution discussion

Gready Solution

The solution to solve this problem use the greedy approach and the algorithm sorts inputs arrays by ending time and check if the next meeting has a good start time (start[i] > end[i - 1]), if yes the meeting in position i can be choose.

The complexity time of this algorithm is O(N log N) and the space complexity is O(1) no additional space is needed.