Frequency count [mp]
Micro pattern¶
Description¶
Count occurrences of values or derived keys for matching, ranking, or aggregation.
Problems¶
Value frequencies¶
Build a frequency table for characters, numbers, or tasks.
- 242. Valid Anagram (Top Easy)
- 350. Intersection of Two Arrays II (Top Easy)
- 387. First Unique Character in a String (Top Easy)
- 347. Top K Frequent Elements (Top Medium)
- 1002. Find Common Characters (Google Prep)
- 621. Task Scheduler (Top Medium)
- 315. Count of Smaller Numbers After Self (Top Hard)
- 740. Delete and Earn (Dynamic Programming)
Window frequencies¶
Increment counts entering a window and decrement counts leaving it.
- 904. Fruit Into Baskets (Google Prep)
- 76. Minimum Window Substring (Top Hard)
Derived-key frequencies¶
Count derived aggregates or properties instead of original values.
- 454. 4Sum II (Top Hard)
- 149. Max Points on a Line (Top Hard)
- 1857. Largest Color Value in a Directed Graph (Graph Theory)