Back to problems

Unique Word Abbreviation

Object-Oriented Programming · Ebay · Easy

Problem Design a data structure that can determine whether a word's abbreviation is unique within a given dictionary. An abbreviation is formed by the following rule: If the length of the word is 2 or less, the abbreviation is the word itself. Otherwise, the abbreviation consists of the first letter, followed by the number of characters strictly between the first and last letter, followed by the last letter. Example: "international" becomes "i11l". Implement the…

Checking your access…