2022-03-27 20:38:29 +08:00
|
|
|
|
<p>实现一个算法,确定一个字符串 <code>s</code> 的所有字符是否全都不同。</p>
|
|
|
|
|
|
|
|
|
|
<p><strong>示例 1:</strong></p>
|
|
|
|
|
|
2023-12-09 18:42:21 +08:00
|
|
|
|
<pre>
|
|
|
|
|
<strong>输入:</strong> <code>s</code> = "leetcode"
|
2022-03-27 20:38:29 +08:00
|
|
|
|
<strong>输出:</strong> false
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
<p><strong>示例 2:</strong></p>
|
|
|
|
|
|
2023-12-09 18:42:21 +08:00
|
|
|
|
<pre>
|
|
|
|
|
<strong>输入:</strong> <code>s</code> = "abc"
|
2022-03-27 20:38:29 +08:00
|
|
|
|
<strong>输出:</strong> true
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
<p><strong>限制:</strong></p>
|
2023-12-09 18:42:21 +08:00
|
|
|
|
|
2022-03-27 20:38:29 +08:00
|
|
|
|
<ul>
|
2023-12-09 18:42:21 +08:00
|
|
|
|
<li><code>0 <= len(s) <= 100 </code></li>
|
|
|
|
|
<li><code>s[i]</code>仅包含小写字母</li>
|
2022-03-27 20:38:29 +08:00
|
|
|
|
<li>如果你不使用额外的数据结构,会很加分。</li>
|
|
|
|
|
</ul>
|