mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-12 17:05:15 +08:00
39 lines
1.3 KiB
HTML
39 lines
1.3 KiB
HTML
<p>给你一个字符串数组 <code>words</code> ,数组中的每个字符串都可以看作是一个单词。请你按 <strong>任意</strong> 顺序返回 <code>words</code> 中是其他单词的 <span data-keyword="substring-nonempty">子字符串</span> 的所有单词。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong class="example">示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>words = ["mass","as","hero","superhero"]
|
||
<strong>输出:</strong>["as","hero"]
|
||
<strong>解释:</strong>"as" 是 "mass" 的子字符串,"hero" 是 "superhero" 的子字符串。
|
||
["hero","as"] 也是有效的答案。
|
||
</pre>
|
||
|
||
<p><strong class="example">示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>words = ["leetcode","et","code"]
|
||
<strong>输出:</strong>["et","code"]
|
||
<strong>解释:</strong>"et" 和 "code" 都是 "leetcode" 的子字符串。
|
||
</pre>
|
||
|
||
<p><strong class="example">示例 3:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>words = ["blue","green","bu"]
|
||
<strong>输出:</strong>[]
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= words.length <= 100</code></li>
|
||
<li><code>1 <= words[i].length <= 30</code></li>
|
||
<li><code>words[i]</code> 仅包含小写英文字母。</li>
|
||
<li>题目数据 <strong>保证</strong> <code>words</code> 的每个字符串都是独一无二的。</li>
|
||
</ul>
|