Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2671. Frequency Tracker
Design a data structure that supports add(number), deleteOne(number), and hasFrequency(f) queries—returning whether any value currently appears exactly f times—under up to 2e5 operations, so each operation must be efficient. The typical solution tracks value->count and count->number-of-values (e.g., two hash maps) to update counts and answer hasFrequency in constant time.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.