The cardinality of lowercase letters is only 26 so we can use a fixed-size array to count the frequency of each character efficiently.