Fetching data...
This may take a moment
Back
2702. Maximum Number of Integers to Choose From a Range II
Medium
Array
Binary Search
Greedy
Sorting
Solve on LeetCode
View Solutions
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.
Similar Questions
First Missing Positive
Hard
Find All Numbers Disappeared in an Array
Easy
Append K Integers With Minimal Sum
Medium
Replace Elements in an Array
Medium
Maximum Number of Integers to Choose From a Range I
Medium
Maximize the Distance Between Points on a Square
Hard
Statistics
Acceptance
34.8%
Submissions
7,987
Accepted
2,781