Earliest Single-Visit ID

Design a data structure that maintains a stream of post(id) events and returns the earliest ID that has appeared exactly once so far.

Implement the following operations:

  • post(id): Record one v...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: