LC: 527. Word Abbreviation - spiralgo/algorithms GitHub Wiki
The Essence: Firstly, we focus on creating abbreviations greedily for all words regardless of the duplicate results. It means, we set the shortest abbreviations for each word. Then we can handle duplicates simply by incrementing the length of all duplicates.
Details:
A more detailed explanation using the word "Spiralgo" and a clear implementation made by Erdem here: https://github.com/spiralgo/algorithms/pull/379