Skip to content

Commit a49a4e6

Browse files
committed
Create README - LeetHub
1 parent 6d2549d commit a49a4e6

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

  • 1071-greatest-common-divisor-of-strings
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<h2><a href="https://leetcode.com/problems/greatest-common-divisor-of-strings">1071. Greatest Common Divisor of Strings</a></h2><h3>Easy</h3><hr><p>For two strings <code>s</code> and <code>t</code>, we say &quot;<code>t</code> divides <code>s</code>&quot; if and only if <code>s = t + t + t + ... + t + t</code> (i.e., <code>t</code> is concatenated with itself one or more times).</p>
2+
3+
<p>Given two strings <code>str1</code> and <code>str2</code>, return <em>the largest string </em><code>x</code><em> such that </em><code>x</code><em> divides both </em><code>str1</code><em> and </em><code>str2</code>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> str1 = &quot;ABCABC&quot;, str2 = &quot;ABC&quot;
10+
<strong>Output:</strong> &quot;ABC&quot;
11+
</pre>
12+
13+
<p><strong class="example">Example 2:</strong></p>
14+
15+
<pre>
16+
<strong>Input:</strong> str1 = &quot;ABABAB&quot;, str2 = &quot;ABAB&quot;
17+
<strong>Output:</strong> &quot;AB&quot;
18+
</pre>
19+
20+
<p><strong class="example">Example 3:</strong></p>
21+
22+
<pre>
23+
<strong>Input:</strong> str1 = &quot;LEET&quot;, str2 = &quot;CODE&quot;
24+
<strong>Output:</strong> &quot;&quot;
25+
</pre>
26+
27+
<p>&nbsp;</p>
28+
<p><strong>Constraints:</strong></p>
29+
30+
<ul>
31+
<li><code>1 &lt;= str1.length, str2.length &lt;= 1000</code></li>
32+
<li><code>str1</code> and <code>str2</code> consist of English uppercase letters.</li>
33+
</ul>

0 commit comments

Comments
 (0)