Problem library

Peak Lobby

Easy
sweep linesorting

Each entry of sessions is [join, leave]: a player is in the lobby from time join up to but not including time leave (join < leave). A player leaving at time t and another joining at time t are never in the lobby together.

Return the largest number of players in the lobby at the same time, or 0 if there are no sessions.

Examples

Input: sessions = [[1,5],[2,6],[5,8]]
Output: 2
Input: sessions = [[0,1],[1,2],[2,3]]
Output: 1