Timed Set (Expiring Set) and How to Test It

Implement a TimedSet, a set whose elements expire, supporting:

  • ADD x t ttl: at time t add element x, which expires at time t+ttl (it is absent when time >= t+ttl); if x already exists, ove...

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: