catDog: as many cats as dogs?

Return true if "cat" and "dog" appear the same number of times in the string. Step through catDog and watch a three-letter window slide along, keeping two separate counts. The else if only checks for "cat" when the window is not "dog".