Modify the duplicate search algorithm. Now it reports the position of
the first duplicate it finds as well as the insertion index of the
current character.