Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2336. Smallest Number in Infinite Set
Maintain an infinite set of positive integers that supports popSmallest(), which removes and returns the current smallest element, and addBack(num), which re-inserts a number if it's missing. The challenge is to efficiently track the next unused integer while handling reinserts so popSmallest always returns the smallest available (constraints: num ≤ 1000, ≤1000 operations).
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.