mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	国外版
This commit is contained in:
		
							
								
								
									
										28
									
								
								算法题(国外版)/long-pressed-name.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								算法题(国外版)/long-pressed-name.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
<p>Your friend is typing his <code>name</code> into a keyboard. Sometimes, when typing a character <code>c</code>, the key might get <em>long pressed</em>, and the character will be typed 1 or more times.</p>
 | 
			
		||||
 | 
			
		||||
<p>You examine the <code>typed</code> characters of the keyboard. Return <code>True</code> if it is possible that it was your friends name, with some characters (possibly none) being long pressed.</p>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Example 1:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> name = "alex", typed = "aaleex"
 | 
			
		||||
<strong>Output:</strong> true
 | 
			
		||||
<strong>Explanation: </strong>'a' and 'e' in 'alex' were long pressed.
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p><strong>Example 2:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> name = "saeed", typed = "ssaaedd"
 | 
			
		||||
<strong>Output:</strong> false
 | 
			
		||||
<strong>Explanation: </strong>'e' must have been pressed twice, but it was not in the typed output.
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Constraints:</strong></p>
 | 
			
		||||
 | 
			
		||||
<ul>
 | 
			
		||||
	<li><code>1 <= name.length, typed.length <= 1000</code></li>
 | 
			
		||||
	<li><code>name</code> and <code>typed</code> consist of only lowercase English letters.</li>
 | 
			
		||||
</ul>
 | 
			
		||||
		Reference in New Issue
	
	Block a user