Tap here to switch tabs
Problem
Submissions

Problem: Missing Element in Sorted Array

med
30 min
Try to solve the Missing Element in Sorted Array problem.

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 kextthk^{ ext{th}} missing number starting from the leftmost element, nums[00].

Constraints:

  • 1≤1 \leq nums.length ≤5imes104\leq 5 imes 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

med
30 min
Try to solve the Missing Element in Sorted Array problem.

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 kextthk^{ ext{th}} missing number starting from the leftmost element, nums[00].

Constraints:

  • 1≤1 \leq nums.length ≤5imes104\leq 5 imes 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