⚡️ Tryprepforge
Backend Engineer Senior programming

You are given an integer array sorted in ascending order, and you need to find a single element that is missing from a sequence defined between the first and last element. Write a function to identify the missing integer. ### Function Signature ```python def missing_number(nums: List[int]) -> int: ``` ### Constraints - `1 <= nums.length <= 10000` - `0 <= nums[i] <= 10000` - Each integer appears exactly once, except for one missing integer. ### Examples 1. Input: `missing_number([0, 1, 2, 3, 4, 6])` Output: `5` 2. Input: `missing_number([1, 2, 3, 5])` Output: `4`

Suggested Answer

Practice More Questions Like This

Generate unlimited interview questions with structured answers, code runner, and AI-powered walkthroughs.

No credit card required

More Backend Engineer Interview Prep

Link copied to clipboard