1060. Missing Element in Sorted Array
https://leetcode.com/problems/missing-element-in-sorted-array
Description
Given an integer array nums
which is sorted in ascending order and all of its elements are unique and given also an integer k
, return the kth
missing number starting from the leftmost number of the array.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 5 * 104
1 <= nums[i] <= 107
nums
is sorted in ascending order, and all the elements are unique.1 <= k <= 108
Follow up: Can you find a logarithmic time complexity (i.e., O(log(n))
) solution?
ac
Previous1059. All Paths from Source Lead to DestinationNext1061. Lexicographically Smallest Equivalent String
Last updated