Your package's release numbers are consecutive whole numbers, but one release was skipped by mistake. releases holds the numbers that were published, sorted ascending. Exactly one number between the first and the last is missing.
Write skippedRelease(releases) that returns the missing number, in O(log n) time.
Input: releases = [4,5,6,8,9] Output: 7
The list jumps from 6 to 8.
Input: releases = [1,3] Output: 2
Only two releases, with 2 missing between them.
2 <= releases.length <= 100000releases[0] and the last release is missing.Run tries your code on the examples. Submit runs every test, including hidden edge cases, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #164 The Skipped Release. I give hints, never the solution, so you get to solve it yourself. Ask for a hint, select code to ask about it, or press Ask Tuto why on a failing test.
Your first 3 answers need no account. for free to keep asking.