10031. Smallest Missing Integer Greater Than Sequential Prefix Sum
You are given a 0-indexed array of integers
nums.A prefix
nums[0..i]is sequential if, for all1 <= j <= i,nums[j] = nums[j - 1] + 1. In particular, the prefix consisting only ofnums[0]is sequential.Return the smallest integer
xmissing fromnumssuch thatxis greater than or equal to the sum of the longest sequential prefix.
1 | class Solution { |