Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2424. Longest Uploaded Prefix
Given out-of-order uploads of videos numbered 1..n, design a data structure that tracks the largest k such that all videos 1..k have been uploaded. Support upload(video) and longest() efficiently (amortized O(1)) by marking arrivals and advancing a pointer while consecutive videos are present.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.