Practice Smallest Missing Integer Greater Than Sequential Prefix Sum
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Smallest Missing Integer Greater Than Sequential Prefix Sum
Problem Statement
You are given a 0-indexed array of integers nums. A prefix nums[0..i] is sequential if, for all 1 <= j <= i, nums[j] = nums[j - 1] + 1. In particular, the prefix consisting only of nums[0] is sequential. Return the smallest integer x missing from nums such that x is greater than or equal to the sum of the longest sequential prefix.
Source: Smallest Missing Integer Greater Than Sequential Prefix Sum on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = [1,2,3,2,5]
6
# Example 2
nums = [3,4,5,1,12,14,13]
15
Constraints
Related LeetCode Problems
Practice more problems similar to Smallest Missing Integer Greater Than Sequential Prefix Sum.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.