Back to problems

OOD Counter Class

Object-Oriented Programming · Uber · Medium

OOD Expiring Counter Class Create a counter that records inserted elements and reports how many copies of each element have not yet expired. Implement the Counter class: Counter(int window) creates a counter whose expiration interval is window seconds. void put(int timestamp, string element) records one additional copy of element at the specified timestamp. int getCount(int timestamp, string element) reports the number of currently valid copies of element at timestamp. int…

Checking your access…