Tap here to switch tabs
Problem
Submissions

Problem: Missing Element in Sorted Array

Missing Element in Sorted Array gives you a strictly ascending array of unique positive integers. Return the kth number missing when counting from the array's first value.

Statement

Given an integer array nums that is sorted in strictly ascending order and consists of unique positive integers, along with an integer k, return the kthk^{ {th}} missing number starting from the leftmost element, nums[00].

Constraints:

  • 1≤1 \leq nums.length ≤5×104\leq 5 \times 10^4

  • 1≤1 \leq nums[i] ≤107\leq 10^7

  • nums is sorted in ascending order, and all the elements are unique.

  • 1≤1 \leq k ≤108\leq 10^8

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Missing Element in Sorted Array

Missing Element in Sorted Array gives you a strictly ascending array of unique positive integers. Return the kth number missing when counting from the array's first value.

Statement

Given an integer array nums that is sorted in strictly ascending order and consists of unique positive integers, along with an integer k, return the kthk^{ {th}} missing number starting from the leftmost element, nums[00].

Constraints:

  • 1≤1 \leq nums.length ≤5×104\leq 5 \times 10^4

  • 1≤1 \leq nums[i] ≤107\leq 10^7

  • nums is sorted in ascending order, and all the elements are unique.

  • 1≤1 \leq k ≤108\leq 10^8