1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-12 17:05:15 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2025-09-29 14:43:44 +08:00
parent 2862a227c4
commit 13f2098086
4409 changed files with 168933 additions and 166256 deletions

View File

@@ -1,15 +1,17 @@
<p>稀疏数组搜索。有个排好序的字符串数组,其中散布着一些空字符串,编写一种方法,找出给定字符串的位置。</p>
<p><strong>示例1:</strong></p>
<p><strong>示例 1</strong></p>
<pre><strong> 输入</strong>: words = [&quot;at&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;ball&quot;, &quot;&quot;, &quot;&quot;, &quot;car&quot;, &quot;&quot;, &quot;&quot;,&quot;dad&quot;, &quot;&quot;, &quot;&quot;], s = &quot;ta&quot;
<strong></strong>-1
<strong> 说明</strong>: 不存在返回-1
<pre>
<strong>入:</strong>words = ["at", "", "", "", "ball", "", "", "car", "", "","dad", "", ""], s = "ta"
<strong> 输出:</strong>-1
<strong> 说明:</strong>不存在返回-1。
</pre>
<p><strong>示例2:</strong></p>
<p><strong>示例 2</strong></p>
<pre><strong> 输入</strong>words = [&quot;at&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;ball&quot;, &quot;&quot;, &quot;&quot;, &quot;car&quot;, &quot;&quot;, &quot;&quot;,&quot;dad&quot;, &quot;&quot;, &quot;&quot;], s = &quot;ball&quot;
<pre>
<strong> 输入</strong>words = ["at", "", "", "", "ball", "", "", "car", "", "","dad", "", ""], s = "ball"
<strong> 输出</strong>4
</pre>