Indeed. There can never be a three character sequence in your string which occurs more frequently than a two character sequence. (Because the three character sequence contains two two character sequences.)
But what should be returned if we have string 'abcabcabcdef' with same amount of three-chars-long and two-chars-long string? 'ab' or 'abc'? I assume OP wants the longer one.