Skip to content

Commit 2e70c28

Browse files
refactor 720
1 parent 8879d2b commit 2e70c28

File tree

1 file changed

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

1 file changed

+0
-28
lines changed

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

-28
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 720. Longest Word in Dictionary.
5-
*
6-
* Given a list of strings words representing an English Dictionary,
7-
* find the longest word in words that can be built one character at a time by other words in words.
8-
* If there is more than one possible answer, return the longest word with the smallest lexicographical order.
9-
* If there is no answer, return the empty string.
10-
11-
Example 1:
12-
Input:
13-
words = ["w","wo","wor","worl", "world"]
14-
Output: "world"
15-
Explanation:
16-
The word "world" can be built one character at a time by "w", "wo", "wor", and "worl".
17-
18-
Example 2:
19-
Input:
20-
words = ["a", "banana", "app", "appl", "ap", "apply", "apple"]
21-
Output: "apple"
22-
Explanation:
23-
Both "apply" and "apple" can be built from other words in the dictionary. However, "apple" is lexicographically smaller than "apply".
24-
25-
Note:
26-
All the strings in the input will only contain lowercase letters.
27-
The length of words will be in the range [1, 1000].
28-
The length of words[i] will be in the range [1, 30].
29-
*/
30-
313
public class _720 {
324
public static class Solution1 {
335
public String longestWord(String[] words) {

0 commit comments

Comments
 (0)