Sum the longest run of consecutive values at the start of the array, then find the smallest missing value at least that sum.
Sum the longest run of consecutive values at the start of the array, then find the smallest missing value at least that sum.
Unlock the full question, the code runner with test cases, and reference solution
One-time unlock. Yours forever.
Or get a for every question, unlimited code runs and AI mock interviews.
Opens with the full question.