Misleading in every sense, let me give a better statement

  • 7

    First of all, definition of abbreviation is misleading. The way <number> was constructed has multiple ways of understanding. It will be much easier to say it is the length after the first and last character are trimmed.
    (My understanding was that in the case of "internationalization" abbreviated into "i18n", 1 comes from the first 'n', i.e. the second character, 8 comes from the last digit of the number above the second character from the end. So my formula was "10+(len(word)-2)%10"....

             1    1  1
    ^                ^

    This of course leads me to wrong result when a word is longer than 22 characters.)

    Then the definition of abbr uniqueness, should be stated like this:
    A word is abbreviation unique in a list if and only if one of the two cases is true:
    1. The word is in the dictionary, then there should be no other word with the same abbr
    2. If the word is not in the dictionary, then the dictionary should have no word with the given word’s abbr

    Now if you look back at the definition in the original question, it's kinda of make sense, but why would you call it "other" if the word itself is not in the dictionary.

  • 0

    Totally agree!

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.