2702. Maximum Number of Integers to Choose From a Range II

Medium
Array
Binary Search
Greedy
Sorting

Description

Hints

Hint 1
It is optimal always to take the smallest possible integer you can choose.
Hint 2
Between every consecutive banned integers, can you find how many integers you can choose?
Hint 3
Think of using binary search to find that.

Statistics

Acceptance
34.8%
Submissions
7,987
Accepted
2,781