Weighted Cache Eviction (Weight-Constrained Cache)

Problem: Weighted Cache Eviction (Weight-Constrained Cache)

Design and implement a cache WeightedCache with a total weight capacity constraint.

Each cache entry has:

  • key
  • value
  • `we...

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: