Mental Model
Two words are anagrams if they have the exact same letters in the same amounts, just mixed up.
Analogy: Imagine two bags of colored beads. If both bags have the same colors and the same number of each color, they are anagrams, even if the beads are arranged differently.
word1: c -> a -> t -> null word2: t -> a -> c -> null We want to check if these two chains have the same beads (letters) in any order.