You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A word's generalized abbreviation can be constructed by taking any number of non-overlapping and non-adjacent substrings and replacing them with their respective lengths.
4
+
5
+
For example, "abcde" can be abbreviated into:
6
+
"a3e" ("bcd" turned into "3")
7
+
"1bcd1" ("a" and "e" both turned into "1")
8
+
"5" ("abcde" turned into "5")
9
+
"abcde" (no substrings replaced)
10
+
However, these abbreviations are invalid:
11
+
"23" ("ab" turned into "2" and "cde" turned into "3") is invalid as the substrings chosen are adjacent.
12
+
"22de" ("ab" turned into "2" and "bc" turned into "2") is invalid as the substring chosen overlap.
13
+
Given a string word, return a list of all the possible generalized abbreviations of word. Return the answer in any order.
0 commit comments