Frequency counting solves many problems:
Find the majority element (appears more than times)
Check if two strings are anagrams (same character frequencies)
Find elements appearing exactly times
Count distinct elements
Find the mode (most frequent element) Whenever you see "count," "frequency," or "how many times," think hash map.