The Challenge: Given two strings s and t, return true if t is an anagram of s, and false otherwise. (An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.)
💡 The "Aha!" Moment
I initially thought about just checking if every letter in s existed in t. But I realized that fails for words with duplicate letters (like "Apple" vs "Pale"). Just knowing a letter exists isn't enough; I needed to know how many times it appears. I needed a full inventory, not just a guest list.
🛠️ My Strategy: The "Inventory Check"