1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 22:13:28 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 12:43:11 +08:00
parent 58bbdfd57c
commit 2b0511d272
10721 changed files with 8123 additions and 8119 deletions

View File

@@ -0,0 +1,30 @@
<p>给你一个字符串 <code>s</code> 和一个字符串数组 <code>dictionary</code> ,找出并返回&nbsp;<code>dictionary</code> 中最长的字符串,该字符串可以通过删除 <code>s</code> 中的某些字符得到。</p>
<p>如果答案不止一个,返回长度最长且字母序最小的字符串。如果答案不存在,则返回空字符串。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>s = "abpcplea", dictionary = ["ale","apple","monkey","plea"]
<strong>输出:</strong>"apple"
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>s = "abpcplea", dictionary = ["a","b","c"]
<strong>输出:</strong>"a"
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= s.length &lt;= 1000</code></li>
<li><code>1 &lt;= dictionary.length &lt;= 1000</code></li>
<li><code>1 &lt;= dictionary[i].length &lt;= 1000</code></li>
<li><code>s</code><code>dictionary[i]</code> 仅由小写英文字母组成</li>
</ul>