All challenges
intermediateData Structures & Algorithms~45 min

Count-Min Sketch

Count frequencies in a stream using a fraction of the memory a hash map would need. Build the sketch grid, add and query with the min-across-rows trick, prove it never under-counts, and merge two sketches — the probabilistic counter behind heavy-hitter and traffic-analytics systems.