mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	国外版
This commit is contained in:
		
							
								
								
									
										27
									
								
								算法题(国外版)/permutation-in-string.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								算法题(国外版)/permutation-in-string.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
<p>Given two strings <code>s1</code> and <code>s2</code>, return <code>true</code><em> if </em><code>s2</code><em> contains a permutation of </em><code>s1</code><em>, or </em><code>false</code><em> otherwise</em>.</p>
 | 
			
		||||
 | 
			
		||||
<p>In other words, return <code>true</code> if one of <code>s1</code>'s permutations is the substring of <code>s2</code>.</p>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Example 1:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> s1 = "ab", s2 = "eidbaooo"
 | 
			
		||||
<strong>Output:</strong> true
 | 
			
		||||
<strong>Explanation:</strong> s2 contains one permutation of s1 ("ba").
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p><strong>Example 2:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> s1 = "ab", s2 = "eidboaoo"
 | 
			
		||||
<strong>Output:</strong> false
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Constraints:</strong></p>
 | 
			
		||||
 | 
			
		||||
<ul>
 | 
			
		||||
	<li><code>1 <= s1.length, s2.length <= 10<sup>4</sup></code></li>
 | 
			
		||||
	<li><code>s1</code> and <code>s2</code> consist of lowercase English letters.</li>
 | 
			
		||||
</ul>
 | 
			
		||||
		Reference in New Issue
	
	Block a user