autocomplete max common substring