#K64972. Minimum Rooms Required for Events
Minimum Rooms Required for Events
Minimum Rooms Required for Events
You are given ( n ) events, each scheduled on a certain day. Two events can be held in the same room if they are on different days. In order to schedule all events without conflict, you need to determine the minimum number of rooms required. Formally, if the events are scheduled on days ( d_1, d_2, \ldots, d_n ), the answer is given by ( \max_{d},\text{frequency}(d) ), where ( \text{frequency}(d) ) is the number of events scheduled on day ( d ).
inputFormat
The first line contains an integer ( n ), the number of events. The second line contains ( n ) space-separated integers, where each integer represents the day on which an event is scheduled.
outputFormat
Output a single integer, the minimum number of rooms required to accommodate all events without any overlap on the same day.## sample
5
1 2 2 1 3
2