1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-28 02:05:15 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/problem (Chinese)/找到初始输入字符串 I [find-the-original-typed-string-i].html
2024-11-07 00:20:26 +08:00

51 lines
1.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>Alice 正在她的电脑上输入一个字符串。但是她打字技术比较笨拙,她&nbsp;<strong>可能</strong>&nbsp;在一个按键上按太久,导致一个字符被输入&nbsp;<strong>多次</strong>&nbsp;</p>
<p>尽管 Alice 尽可能集中注意力,她仍然可能会犯错 <strong>至多</strong>&nbsp;一次。</p>
<p>给你一个字符串&nbsp;<code>word</code> ,它表示 <strong>最终</strong>&nbsp;显示在 Alice 显示屏上的结果。</p>
<p>请你返回 Alice 一开始可能想要输入字符串的总方案数。</p>
<p>&nbsp;</p>
<p><strong class="example">示例 1</strong></p>
<div class="example-block">
<p><span class="example-io"><b>输入:</b>word = "abbcccc"</span></p>
<p><span class="example-io"><b>输出:</b>5</span></p>
<p><strong>解释:</strong></p>
<p>可能的字符串包括:<code>"abbcccc"</code>&nbsp;<code>"abbccc"</code>&nbsp;<code>"abbcc"</code>&nbsp;<code>"abbc"</code>&nbsp;&nbsp;<code>"abcccc"</code>&nbsp;</p>
</div>
<p><strong class="example">示例 2</strong></p>
<div class="example-block">
<p><span class="example-io"><b>输入:</b>word = "abcd"</span></p>
<p><span class="example-io"><b>输出:</b>1</span></p>
<p><strong>解释:</strong></p>
<p>唯一可能的字符串是&nbsp;<code>"abcd"</code>&nbsp;</p>
</div>
<p><strong class="example">示例 3</strong></p>
<div class="example-block">
<p><span class="example-io"><b>输入:</b>word = "aaaa"</span></p>
<p><span class="example-io"><b>输出:</b>4</span></p>
</div>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= word.length &lt;= 100</code></li>
<li><code>word</code>&nbsp;只包含小写英文字母。</li>
</ul>