1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/键盘行 [keyboard-row].html
2022-03-29 12:43:11 +08:00

45 lines
1.2 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>给你一个字符串数组 <code>words</code> ,只返回可以使用在 <strong>美式键盘</strong> 同一行的字母打印出来的单词。键盘如下图所示。</p>
<p><strong>美式键盘</strong> 中:</p>
<ul>
<li>第一行由字符 <code>"qwertyuiop"</code> 组成。</li>
<li>第二行由字符 <code>"asdfghjkl"</code> 组成。</li>
<li>第三行由字符 <code>"zxcvbnm"</code> 组成。</li>
</ul>
<p><img alt="American keyboard" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/10/12/keyboard.png" style="width: 100%; max-width: 600px" /></p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>words = ["Hello","Alaska","Dad","Peace"]
<strong>输出:</strong>["Alaska","Dad"]
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>words = ["omk"]
<strong>输出:</strong>[]
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>words = ["adsdf","sfd"]
<strong>输出:</strong>["adsdf","sfd"]
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= words.length <= 20</code></li>
<li><code>1 <= words[i].length <= 100</code></li>
<li><code>words[i]</code> 由英文字母(小写和大写字母)组成</li>
</ul>