String max frequency video 3 strings

also there can be a case when two alphabhets have the same freq so do we need to count for that case also???