Here all we have to do is step through all adjacent pairs of characters, keeping track of two-gram frequency, then report the pair of characters which occurs most frequent.