dsa1 min read
Most Common Word — Normalize + Frequency Map
Find the most common word not in a banned list by normalizing input and using a frequency counter.
Read →
1575 articles
Find the most common word not in a banned list by normalizing input and using a frequency counter.
Determine if cards can be rearranged into consecutive groups of size groupSize using a sorted frequency map.
Count subarrays with sum divisible by k using prefix mod frequencies and the complement map pattern.
Count pairs summing to a power of 2 by checking all 22 powers-of-2 against a running frequency map.
Design a time-stamped key-value store supporting set and get(key, timestamp) using binary search on sorted timestamps.