Back to all patterns

Hash Map / Frequency Counter

3 problems • Practice on LeetCode to earn credits

About This Pattern

Master the Hash Map / Frequency Counter pattern by practicing these problems organized by difficulty.Focus on the Key Signals - these are the indicators that tell you when to use this pattern.

Easy (3)

Valid Anagram

Given two strings s and t, return true if t is an anagram of s.

Key Signals:

Character frequencyCounting occurrencesComparison of collections
Valid Anagram

Given two strings s and t, return true if t is an anagram of s.

Key Signals:

Character frequencyCounting occurrencesComparison
Palindrome Permutation

Given a string, determine if a permutation of the string could form a palindrome.

Key Signals:

Character frequencyAt most one oddPalindrome properties