#K72647. Maximum Log Overlap
Maximum Log Overlap
Maximum Log Overlap
You are given a set of logs, each represented by a time interval. Each log is defined by two integers: a start time and an end time. Your task is to compute the maximum number of logs that overlap at any moment in time.
Formally, let there be n logs. For each log i, you are given a time interval \([s_i, e_i]\). Two logs are considered to be overlapping at time \(t\) if \(s_i \le t < e_i\). Note that if one log ends exactly when another starts, they do not overlap.
Your goal is to find the maximum value of \(O(t)\) over all time \(t\), where \(O(t)\) denotes the number of logs in progress at time \(t\).
inputFormat
The first line contains a single integer n representing the number of logs. Each of the following n lines contains two space-separated integers \(s\) and \(e\) denoting the start and end times of a log.
You can assume that \(1 \le n \le 10^5\) and all time values are integers.
outputFormat
Output a single integer representing the maximum number of overlapping logs.
## sample3
1 4
2 3
5 6
2
</p>