1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/活字印刷 [letter-tile-possibilities].html

36 lines
888 B
HTML
Raw Normal View History

2022-03-27 20:37:52 +08:00
<p>你有一套活字字模&nbsp;<code>tiles</code>,其中每个字模上都刻有一个字母&nbsp;<code>tiles[i]</code>。返回你可以印出的非空字母序列的数目。</p>
<p><strong>注意:</strong>本题中,每个活字字模只能使用一次。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>"AAB"
<strong>输出:</strong>8
<strong>解释:</strong>可能的序列为 "A", "B", "AA", "AB", "BA", "AAB", "ABA", "BAA"。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>"AAABBC"
<strong>输出:</strong>188
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>"V"
<strong>输出:</strong>1</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= tiles.length &lt;= 7</code></li>
<li><code>tiles</code> 由大写英文字母组成</li>
</ul>