For example, in this table, the substrings at indices 2 to 4 (in red) and indices 6 to 8 (in blue) are a maximal pair, because they contain identical characters (abc), and they have different characters to the left (x at index 1 and y at index 5) and different characters to the right (y at index 5 and w at index 9).
For example, in this table, the substrings from positions 2 to 4 (in red) and from positions 6 to 8 (in blue) form a maximal pair. Both pairs contain identical characters (abc), have different characters before them (x at position 1 and y at position 5), and different characters after them (y at position 5 and w at position 9).