End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
Given an array of distinct strings words, return the minimal possible abbreviations for every word.
The following are the rules for a string abbreviation:
1.
["abcdef","abndef"] both initially abbreviated as "a4f". Then, a sequence of operations would be ["a4f","a4f"] -> ["ab3f","ab3f"] -> ["abc2f","abn2f"].
Example 1:
Input: words = ["like","god","internal","me","internet","interval","intension","face","intrusion"] Output: ["l2e","god","internal","me","i6t","interval","inte4n","f2e","intr4n"]
Example 2:
Input: words = ["aa","aaa"] Output: ["aa","aaa"]
Constraints:
1 <= words.length <= 4002 <= words[i].length <= 400words[i] consists of lowercase English letters.words are unique.