A video player received frames numbered 0 to n, but one frame was dropped. frames holds the n frame numbers that arrived, in any order.
Write droppedFrame(frames) that returns the missing number, using O(1) extra memory.
Input: frames = [3,0,1] Output: 2
Frames 0 to 3 should all be there, and 2 is missing.
Input: frames = [0,1] Output: 2
The last frame, 2, is the one missing.
1 <= frames.length <= 10^50 and frames.length.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 #672 Missing Frame Number. 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.