First unique number in a stream upon terminating number
Filed under Bloomberg
The question
Given a continuous stream of numbers and a specified terminating number, write a function that returns the first unique number whenever the terminating number is reached, optimized to O(1) time on termination via preprocessing.
No write-up yet. Related questions below have one.
Related Bloomberg questions
Collected from public candidate posts and coding forums. Updated Nov 2026.