Skip to content

Commit ebc1704

Browse files
committed
Create README - LeetHub
1 parent 8c77e92 commit ebc1704

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

longest-word-in-dictionary/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<h2>720. Longest Word in Dictionary</h2><h3>Easy</h3><hr><div><p>Given a list of strings <code>words</code> representing an English Dictionary, find the longest word in <code>words</code> that can be built one character at a time by other words in <code>words</code>. If there is more than one possible answer, return the longest word with the smallest lexicographical order.</p> If there is no answer, return the empty string.
2+
3+
<p><b>Example 1:</b><br>
4+
</p><pre><b>Input:</b>
5+
words = ["w","wo","wor","worl", "world"]
6+
<b>Output:</b> "world"
7+
<b>Explanation:</b>
8+
The word "world" can be built one character at a time by "w", "wo", "wor", and "worl".
9+
</pre>
10+
<p></p>
11+
12+
<p><b>Example 2:</b><br>
13+
</p><pre><b>Input:</b>
14+
words = ["a", "banana", "app", "appl", "ap", "apply", "apple"]
15+
<b>Output:</b> "apple"
16+
<b>Explanation:</b>
17+
Both "apply" and "apple" can be built from other words in the dictionary. However, "apple" is lexicographically smaller than "apply".
18+
</pre>
19+
<p></p>
20+
21+
<p><b>Note:</b>
22+
</p><li>All the strings in the input will only contain lowercase letters.</li>
23+
<li>The length of <code>words</code> will be in the range <code>[1, 1000]</code>.</li>
24+
<li>The length of <code>words[i]</code> will be in the range <code>[1, 30]</code>.</li>
25+
<p></p></div>

0 commit comments

Comments
 (0)