Valid Anagram: count what matters
Use a frequency map to compare two strings, and understand when counting is a better fit than sorting. LeetCode 242, explained.
Engineering resources
Understand the approach, not just the answer. Practical explanations, worked examples, and honest trade-offs.
Use a frequency map to compare two strings, and understand when counting is a better fit than sorting. LeetCode 242, explained.
Learn when a set is the right tool, and what you trade away when you sort instead. A worked explanation of LeetCode 217.