Skip to content

Commit 2265d57

Browse files
refactor 527
1 parent 2a89bbb commit 2265d57

File tree

1 file changed

+0
-22
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-22
lines changed

src/main/java/com/fishercoder/solutions/_527.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,6 @@
44
import java.util.HashSet;
55
import java.util.List;
66

7-
/**
8-
* 527. Word Abbreviation
9-
*
10-
* Given an array of n distinct non-empty strings, you need to generate minimal possible abbreviations for every word following rules below.
11-
12-
Begin with the first character and then the number of characters abbreviated, which followed by the last character.
13-
If there are any conflict, that is more than one words share the same abbreviation,
14-
a longer prefix is used instead of only the first character until making the map
15-
from word to abbreviation become unique.
16-
In other words, a final abbreviation cannot map to more than one original words.
17-
If the abbreviation doesn't make the word shorter, then keep it as original.
18-
19-
Example:
20-
Input: ["like", "god", "internal", "me", "internet", "interval", "intension", "face", "intrusion"]
21-
Output: ["l2e","god","internal","me","i6t","interval","inte4n","f2e","intr4n"]
22-
23-
Note:
24-
Both n and the length of each word will not exceed 400.
25-
The length of each word is greater than 1.
26-
The words consist of lowercase English letters only.
27-
The return answers should be in the same order as the original array.
28-
*/
297
public class _527 {
308

319
public static class Solution1 {

0 commit comments

Comments
 (0)