Class Solution
java.lang.Object
g1301_1400.s1324_print_words_vertically.Solution
1324 - Print Words Vertically.<p>Medium</p>
<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><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “HOW ARE YOU”</p>
<p><strong>Output:</strong> [“HAY”,“ORO”,“WEU”]</p>
<p><strong>Explanation:</strong> Each word is printed vertically.</p>
<p>“HAY”</p>
<p>“ORO”</p>
<p>“WEU”</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “TO BE OR NOT TO BE”</p>
<p><strong>Output:</strong> [“TBONTB”,“OEROOE”," T"]</p>
<p><strong>Explanation:</strong> Trailing spaces is not allowed.</p>
<p>“TBONTB”</p>
<p>“OEROOE”</p>
<p>" T"</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> s = “CONTEST IS COMING”</p>
<p><strong>Output:</strong> [“CIC”,“OSO”,“N M”,“T I”,“E N”,“S G”,“T”]</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= s.length <= 200</code></li>
<li><code>s</code> contains only upper case English letters.</li>
<li>It’s guaranteed that there is only one space between 2 words.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
printVertically
-