Concept
Count how often each value appears with a hash map, then answer questions from the counts: anagrams, most common element, first unique character. It turns many O(n^2) comparisons into O(n).
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Frequency counting doing its job.
from collections import Counter
def is_anagram(a, b):
return Counter(a) == Counter(b)
def first_unique(s):
counts = Counter(s)
for i, ch in enumerate(s):
if counts[ch] == 1:
return i
return -1Sorting both strings to compare anagrams when a count works. Sorting is O(n log n) and allocates; a counter is O(n) and reads as what it means.
Your roadmap puts these before Frequency counting, unless you already know them.
Once a session shows you understand Frequency counting, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on Frequency counting.