Skip to content

Commit 7c66a37

Browse files
committed
Create README - LeetHub
1 parent e250fbe commit 7c66a37

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

reverse-string/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<h2>344. Reverse String</h2><h3>Easy</h3><hr><div><p>Write a function that reverses a string. The input string is given as an array of characters <code>s</code>.</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong>Example 1:</strong></p>
5+
<pre><strong>Input:</strong> s = ["h","e","l","l","o"]
6+
<strong>Output:</strong> ["o","l","l","e","h"]
7+
</pre><p><strong>Example 2:</strong></p>
8+
<pre><strong>Input:</strong> s = ["H","a","n","n","a","h"]
9+
<strong>Output:</strong> ["h","a","n","n","a","H"]
10+
</pre>
11+
<p>&nbsp;</p>
12+
<p><strong>Constraints:</strong></p>
13+
14+
<ul>
15+
<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
16+
<li><code>s[i]</code> is a <a href="https://en.wikipedia.org/wiki/ASCII#Printable_characters" target="_blank">printable ascii character</a>.</li>
17+
</ul>
18+
19+
<p>&nbsp;</p>
20+
<p><strong>Follow up:</strong> Do not allocate extra space for another array. You must do this by modifying the input array <a href="https://en.wikipedia.org/wiki/In-place_algorithm" target="_blank">in-place</a> with <code>O(1)</code> extra memory.</p>
21+
</div>

0 commit comments

Comments
 (0)