Mental Model
Two words are anagrams if they have the same letters in the same amounts, just mixed differently.
Analogy: Imagine two bags of colored beads. If both bags have the exact same colors and counts of beads, they are anagrams, even if the beads are arranged differently inside.
word1: c -> a -> t -> null word2: t -> a -> c -> null Check if both have same letters and counts.
