The built-in Abbrev module can calculate a set of unambiguous abbreviations for a set of strings, and then you can look for the shortest result for each string.

The built-in Abbrev module can calculate a set of unambiguous abbreviations for a set of strings, and then you can look for the shortest result for each string.