Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dc6d5d8

Browse files
committed
Create README - LeetHub
1 parent d61db0d commit dc6d5d8

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

‎97-interleaving-string/README.md‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<h2><a href="https://leetcode.com/problems/interleaving-string/">97. Interleaving String</a></h2><h3>Medium</h3><hr><div><p>Given strings <code>s1</code>, <code>s2</code>, and <code>s3</code>, find whether <code>s3</code> is formed by an <strong>interleaving</strong> of <code>s1</code> and <code>s2</code>.</p>
2+
3+
<p>An <strong>interleaving</strong> of two strings <code>s</code> and <code>t</code> is a configuration where they are divided into <strong>non-empty</strong> substrings such that:</p>
4+
5+
<ul>
6+
<li><code>s = s<sub>1</sub> + s<sub>2</sub> + ... + s<sub>n</sub></code></li>
7+
<li><code>t = t<sub>1</sub> + t<sub>2</sub> + ... + t<sub>m</sub></code></li>
8+
<li><code>|n - m| &lt;= 1</code></li>
9+
<li>The <strong>interleaving</strong> is <code>s<sub>1</sub> + t<sub>1</sub> + s<sub>2</sub> + t<sub>2</sub> + s<sub>3</sub> + t<sub>3</sub> + ...</code> or <code>t<sub>1</sub> + s<sub>1</sub> + t<sub>2</sub> + s<sub>2</sub> + t<sub>3</sub> + s<sub>3</sub> + ...</code></li>
10+
</ul>
11+
12+
<p><strong>Note:</strong> <code>a + b</code> is the concatenation of strings <code>a</code> and <code>b</code>.</p>
13+
14+
<p>&nbsp;</p>
15+
<p><strong>Example 1:</strong></p>
16+
<img alt="" src="https://assets.leetcode.com/uploads/2020/09/02/interleave.jpg" style="width: 561px; height: 203px;">
17+
<pre><strong>Input:</strong> s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac"
18+
<strong>Output:</strong> true
19+
</pre>
20+
21+
<p><strong>Example 2:</strong></p>
22+
23+
<pre><strong>Input:</strong> s1 = "aabcc", s2 = "dbbca", s3 = "aadbbbaccc"
24+
<strong>Output:</strong> false
25+
</pre>
26+
27+
<p><strong>Example 3:</strong></p>
28+
29+
<pre><strong>Input:</strong> s1 = "", s2 = "", s3 = ""
30+
<strong>Output:</strong> true
31+
</pre>
32+
33+
<p>&nbsp;</p>
34+
<p><strong>Constraints:</strong></p>
35+
36+
<ul>
37+
<li><code>0 &lt;= s1.length, s2.length &lt;= 100</code></li>
38+
<li><code>0 &lt;= s3.length &lt;= 200</code></li>
39+
<li><code>s1</code>, <code>s2</code>, and <code>s3</code> consist of lowercase English letters.</li>
40+
</ul>
41+
42+
<p>&nbsp;</p>
43+
<p><strong>Follow up:</strong> Could you solve it using only <code>O(s2.length)</code> additional memory space?</p>
44+
</div>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /