Problems > Favourite Bigram > Editorial

Favourite Bigram — Solution & Editorial

Back to the Problem

Count all |S|−1 bigrams in a map; pick the smallest among maxima.

Complexity: O(|S|)