Dynamic Random Pick with Add and Remove Key
Problem: Dynamic Weighted Random Key Generator
Design a class RandomKeyGenerator that supports the following operations:
add_key(key: str) -> None- Add one occurrence of
key. - If...
- Add one occurrence of
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:
