Shortest unique abbreviation for every word

0
Remix

Abbreviate each word in a list of distinct words as a prefix, the count of the letters in between, and the last letter (like becomes l2e). When two words share an abbreviation, lengthen their prefixes until every abbreviation is unique, and keep a word whole if abbreviating does not make it shorter. Return the abbreviations in input order.

MetaCodingLast asked Feb 2026
No answer yet. Write the first one; the best answer gets endorsed.