1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<p><strong>独一无二的字符串</strong>&nbsp;指的是在一个数组中只出现过 <strong>一次</strong>&nbsp;的字符串。</p>
<p>给你一个字符串数组&nbsp;<code>arr</code>&nbsp;和一个整数&nbsp;<code>k</code>&nbsp;,请你返回&nbsp;<code>arr</code>&nbsp;中第&nbsp;<code>k</code>&nbsp;&nbsp;<strong>独一无二的字符串</strong>&nbsp;。如果&nbsp;<strong>少于</strong>&nbsp;<code>k</code>&nbsp;个独一无二的字符串,那么返回&nbsp;<strong>空字符串</strong>&nbsp;<code>""</code>&nbsp;</p>
<p>注意,按照字符串在原数组中的 <strong>顺序</strong>&nbsp;找到第 <code>k</code>&nbsp;个独一无二字符串。</p>
<p>&nbsp;</p>
<p><strong>示例 1:</strong></p>
<pre><b>输入:</b>arr = ["d","b","c","b","c","a"], k = 2
<b>输出:</b>"a"
<strong>解释:</strong>
arr 中独一无二字符串包括 "d" 和 "a"<code>&nbsp;</code>
"d" 首先出现,所以它是第 1 个独一无二字符串。
"a" 第二个出现,所以它是 2 个独一无二字符串。
由于 k == 2 ,返回 "a" 。
</pre>
<p><strong>示例 2:</strong></p>
<pre><b>输入:</b>arr = ["aaa","aa","a"], k = 1
<b>输出:</b>"aaa"
<strong>解释:</strong>
arr 中所有字符串都是独一无二的,所以返回第 1 个字符串 "aaa" 。
</pre>
<p><strong>示例 3</strong></p>
<pre><b>输入:</b>arr = ["a","b","a"], k = 3
<b>输出:</b>""
<strong>解释:</strong>
唯一一个独一无二字符串是 "b" 。由于少于 3 个独一无二字符串,我们返回空字符串 "" 。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= k &lt;= arr.length &lt;= 1000</code></li>
<li><code>1 &lt;= arr[i].length &lt;= 5</code></li>
<li><code>arr[i]</code>&nbsp;只包含小写英文字母。</li>
</ul>