low to high inclusive. Some of these floors are set aside as lounges; their numbers are listed in the array lounges. Every other rented floor is an office floor.
Return the largest number of consecutive office floors with no lounge between them. If there are no office floors, return 0.low=10, high=20, lounges=[13, 14, 19] → 4
Office floors come in runs 10–12 (3 floors), 15–18 (4 floors) and 20 (1 floor). The longest run has 4 floors.
low=4, high=5, lounges=[5, 4] → 0
Both floors are lounges, so there are no office floors at all.
low=1, high=100, lounges=[1] → 99
The only lounge is on floor 1, so floors 2–100 form one run of 99 floors.
lounges.length ≤ 10⁵low ≤ lounges[i] ≤ high ≤ 10⁹lounges are distinctlow=10, high=20, lounges=[13, 14, 19]
4
Run checks the first 3 tests in your browser. Submit checks all 95 tests on the server, hidden ones included.