Design a Dictionary with Specific Operations

Design a dictionary that supports the following operations:

  • get operation in O(1) complexity.
  • put operation in O(1) complexity.
  • delete operation in O(n) complexity.
  • get_random_val ope...

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: