mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	add scripts and problemset
This commit is contained in:
		
							
								
								
									
										42
									
								
								算法题/print-words-vertically.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								算法题/print-words-vertically.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
<p>Given a string <code>s</code>. Return all the words vertically in the same order in which they appear in <code>s</code>.<br />
 | 
			
		||||
 | 
			
		||||
Words are returned as a list of strings, complete with spaces when is necessary. (Trailing spaces are not allowed).<br />
 | 
			
		||||
 | 
			
		||||
Each word would be put on only one column and that in one column there will be only one word.</p>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
 | 
			
		||||
<p><strong>Example 1:</strong></p>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
 | 
			
		||||
<strong>Input:</strong> s = "HOW ARE YOU"
 | 
			
		||||
 | 
			
		||||
<strong>Output:</strong> ["HAY","ORO","WEU"]
 | 
			
		||||
 | 
			
		||||
<strong>Explanation: </strong>Each word is printed vertically. 
 | 
			
		||||
 | 
			
		||||
 "HAY"
 | 
			
		||||
 | 
			
		||||
 "ORO"
 | 
			
		||||
 | 
			
		||||
 "WEU"
 | 
			
		||||
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<p><strong>Example 2:</strong></p>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
 | 
			
		||||
<strong>Input:</strong> s = "TO BE OR NOT TO BE"
 | 
			
		||||
 | 
			
		||||
<strong>Output:</strong> ["TBONTB","OEROOE","   T"]
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user