filter(fn (string $word) => ctype_alpha($word)) ->filter(fn (string $word) => strtolower($word) === $word) ->map(fn (string $word) => new Collection(explode($word, ""))) ->filter(fn (Collection $wordChars) => $wordChars->count() === $anagramChars->intersect($wordChars)->count()) ->count(); // ->map(fn (Collection $wordChars) => $wordChars->join("")) // ->each(fn (string $word) => output($word));