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 b8a8f59

Browse files
author
Shuo
authored
Merge pull request #576 from openset/develop
Update: question
2 parents 0b803d8 + 5f8e3a2 commit b8a8f59

File tree

16 files changed

+553
-8
lines changed

16 files changed

+553
-8
lines changed

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ LeetCode Problems' Solutions
7878
| <span id="1053">1053</span> | [Previous Permutation With One Swap](https://leetcode.com/problems/previous-permutation-with-one-swap "交换一次的先前排列") | [Go](https://github.com/openset/leetcode/tree/master/problems/previous-permutation-with-one-swap) | Medium |
7979
| <span id="1052">1052</span> | [Grumpy Bookstore Owner](https://leetcode.com/problems/grumpy-bookstore-owner "爱生气的书店老板") | [Go](https://github.com/openset/leetcode/tree/master/problems/grumpy-bookstore-owner) | Medium |
8080
| <span id="1051">1051</span> | [Height Checker](https://leetcode.com/problems/height-checker "高度检查器") | [Go](https://github.com/openset/leetcode/tree/master/problems/height-checker) | Easy |
81-
| <span id="1050">1050</span> | [Actors and Directors Who Cooperated At Least Three Times](https://leetcode.com/problems/actors-and-directors-who-cooperated-at-least-three-times) 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/actors-and-directors-who-cooperated-at-least-three-times) | Easy |
81+
| <span id="1050">1050</span> | [Actors and Directors Who Cooperated At Least Three Times](https://leetcode.com/problems/actors-and-directors-who-cooperated-at-least-three-times"合作过至少三次的演员和导演") 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/actors-and-directors-who-cooperated-at-least-three-times) | Easy |
8282
| <span id="1049">1049</span> | [Last Stone Weight II](https://leetcode.com/problems/last-stone-weight-ii "最后一块石头的重量 II") | [Go](https://github.com/openset/leetcode/tree/master/problems/last-stone-weight-ii) | Medium |
8383
| <span id="1048">1048</span> | [Longest String Chain](https://leetcode.com/problems/longest-string-chain "最长字符串链") | [Go](https://github.com/openset/leetcode/tree/master/problems/longest-string-chain) | Medium |
8484
| <span id="1047">1047</span> | [Remove All Adjacent Duplicates In String](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string "删除字符串中的所有相邻重复项") | [Go](https://github.com/openset/leetcode/tree/master/problems/remove-all-adjacent-duplicates-in-string) | Easy |
8585
| <span id="1046">1046</span> | [Last Stone Weight](https://leetcode.com/problems/last-stone-weight "最后一块石头的重量") | [Go](https://github.com/openset/leetcode/tree/master/problems/last-stone-weight) | Easy |
86-
| <span id="1045">1045</span> | [Customers Who Bought All Products](https://leetcode.com/problems/customers-who-bought-all-products) 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/customers-who-bought-all-products) | Medium |
86+
| <span id="1045">1045</span> | [Customers Who Bought All Products](https://leetcode.com/problems/customers-who-bought-all-products"买下所有产品的客户") 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/customers-who-bought-all-products) | Medium |
8787
| <span id="1044">1044</span> | [Longest Duplicate Substring](https://leetcode.com/problems/longest-duplicate-substring "最长重复子串") | [Go](https://github.com/openset/leetcode/tree/master/problems/longest-duplicate-substring) | Hard |
8888
| <span id="1043">1043</span> | [Partition Array for Maximum Sum](https://leetcode.com/problems/partition-array-for-maximum-sum "分隔数组以得到最大和") | [Go](https://github.com/openset/leetcode/tree/master/problems/partition-array-for-maximum-sum) | Medium |
8989
| <span id="1042">1042</span> | [Flower Planting With No Adjacent](https://leetcode.com/problems/flower-planting-with-no-adjacent "不邻接植花") | [Go](https://github.com/openset/leetcode/tree/master/problems/flower-planting-with-no-adjacent) | Easy |

‎problems/all-paths-from-source-lead-to-destination/README.md‎

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,82 @@
99

1010
[Next >](https://github.com/openset/leetcode/tree/master/problems/missing-element-in-sorted-array "Missing Element in Sorted Array")
1111

12-
## 1059. All Paths from Source Lead to Destination (Medium)
12+
## 1059. All Paths from Source Lead to Destination (Hard)
1313

14+
<p>Given the <code>edges</code> of a directed graph, and two nodes <code>source</code> and <code>destination</code> of this graph, determine whether or not all paths starting from <code>source</code> eventually end at <code>destination</code>, that is:</p>
1415

16+
<ul>
17+
<li>At least one path exists from the <code>source</code> node to the <code>destination</code> node</li>
18+
<li>If a path exists from the <code>source</code> node to a node with no outgoing edges, then that node is equal to <code>destination</code>.</li>
19+
<li>The number of possible paths from <code>source</code> to <code>destination</code> is a finite number.</li>
20+
</ul>
21+
22+
<p>Return <code>true</code> if and only if all roads from <code>source</code> lead to <code>destination</code>.</p>
23+
24+
<p>&nbsp;</p>
25+
26+
<p><strong>Example 1:</strong></p>
27+
28+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/16/485_example_1.png" style="width: 200px; height: 208px;" /></p>
29+
30+
<pre>
31+
<strong>Input: </strong>n = 3, edges = <span id="example-input-1-2">[[0,1],[0,2]]</span>, source = <span id="example-input-1-3">0</span>, destination = 2
32+
<strong>Output: </strong><span id="example-output-1">false</span>
33+
<strong>Explanation: </strong>It is possible to reach and get stuck on both node 1 and node 2.
34+
</pre>
35+
36+
<p><strong>Example 2:</strong></p>
37+
38+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/16/485_example_2.png" style="width: 200px; height: 230px;" /></p>
39+
40+
<pre>
41+
<strong>Input: </strong>n = <span id="example-input-2-1">4</span>, edges = <span id="example-input-2-2">[[0,1],[0,3],[1,2],[2,1]]</span>, source = <span id="example-input-2-3">0</span>, destination = <span id="example-input-2-4">3</span>
42+
<strong>Output: </strong><span id="example-output-2">false</span>
43+
<strong>Explanation: </strong>We have two possibilities: to end at node 3, or to loop over node 1 and node 2 indefinitely.
44+
</pre>
45+
46+
<p><strong>Example 3:</strong></p>
47+
48+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/16/485_example_3.png" style="width: 200px; height: 183px;" /></p>
49+
50+
<pre>
51+
<strong>Input: </strong>n = <span id="example-input-3-1">4</span>, edges = <span id="example-input-3-2">[[0,1],[0,2],[1,3],[2,3]]</span>, source = <span id="example-input-3-3">0</span>, destination = <span id="example-input-3-4">3</span>
52+
<strong>Output: </strong><span id="example-output-3">true</span>
53+
</pre>
54+
55+
<p><strong>Example 4:</strong></p>
56+
57+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/16/485_example_4.png" style="width: 200px; height: 183px;" /></p>
58+
59+
<pre>
60+
<strong>Input: </strong>n = <span id="example-input-4-1">3</span>, edges = <span id="example-input-4-2">[[0,1],[1,1],[1,2]]</span>, source = <span id="example-input-4-3">0</span>, destination = <span id="example-input-4-4">2</span>
61+
<strong>Output: </strong><span id="example-output-4">false</span>
62+
<strong>Explanation: </strong>All paths from the source node end at the destination node, but there are an infinite number of paths, such as 0-1-2, 0-1-1-2, 0-1-1-1-2, 0-1-1-1-1-2, and so on.
63+
</pre>
64+
65+
<p><strong>Example 5:</strong></p>
66+
67+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/16/485_example_5.png" style="width: 150px; height: 131px;" /></p>
68+
69+
<pre>
70+
<strong>Input: </strong>n = <span id="example-input-5-1">2</span>, edges = <span id="example-input-5-2">[[0,1],[1,1]]</span>, source = <span id="example-input-5-3">0</span>, destination = <span id="example-input-5-4">1</span>
71+
<strong>Output: </strong><span id="example-output-5">false</span>
72+
<strong>Explanation: </strong>There is infinite self-loop at destination node.
73+
</pre>
74+
75+
<p>&nbsp;</p>
76+
77+
<p><strong>Note:</strong></p>
78+
79+
<ol>
80+
<li><italic>The given graph may have self loops and parallel edges.</italic></li>
81+
<li>The number of nodes <code>n</code> in the graph is between <code>1</code> and <code>10000</code></li>
82+
<li>The number of edges in the graph is between <code>0</code> and <code>10000</code></li>
83+
<li><code>0 &lt;= edges.length &lt;= 10000</code></li>
84+
<li><code>edges[i].length == 2</code></li>
85+
<li><code>0 &lt;= source &lt;= n - 1</code></li>
86+
<li><code>0 &lt;= destination &lt;= n - 1</code></li>
87+
</ol>
1588

1689
### Related Topics
1790
[[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)]

‎problems/campus-bikes-ii/README.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,47 @@
1111

1212
## 1066. Campus Bikes II (Medium)
1313

14+
<p>On a campus represented as a 2D grid, there are <code>N</code> workers and <code>M</code> bikes, with <code>N &lt;= M</code>. Each worker and bike is a 2D coordinate on this grid.</p>
1415

16+
<p>We assign one unique bike to each worker so that the sum of the Manhattan distances between each worker and their assigned bike is minimized.</p>
17+
18+
<p>The Manhattan distance between two points <code>p1</code> and <code>p2</code> is <code>Manhattan(p1, p2) = |p1.x - p2.x| + |p1.y - p2.y|</code>.</p>
19+
20+
<p>Return the minimum possible sum of Manhattan distances between each worker and their assigned bike.</p>
21+
22+
<p>&nbsp;</p>
23+
24+
<p><strong>Example 1:</strong></p>
25+
26+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/06/1261_example_1_v2.png" style="width: 264px; height: 264px;" /></p>
27+
28+
<pre>
29+
<strong>Input: </strong>workers = <span id="example-input-1-1">[[0,0],[2,1]]</span>, bikes = <span id="example-input-1-2">[[1,2],[3,3]]</span>
30+
<strong>Output: </strong><span id="example-output-1">6</span>
31+
<strong>Explanation: </strong>
32+
We assign bike 0 to worker 0, bike 1 to worker 1. The Manhattan distance of both assignments is 3, so the output is 6.
33+
</pre>
34+
35+
<p><strong>Example 2:</strong></p>
36+
37+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/06/1261_example_2_v2.png" style="width: 264px; height: 264px;" /></p>
38+
39+
<pre>
40+
<strong>Input: </strong>workers = <span id="example-input-2-1">[[0,0],[1,1],[2,0]]</span>, bikes = <span id="example-input-2-2">[[1,0],[2,2],[2,1]]</span>
41+
<strong>Output: </strong><span id="example-output-2">4</span>
42+
<strong>Explanation: </strong>
43+
We first assign bike 0 to worker 0, then assign bike 1 to worker 1 or worker 2, bike 2 to worker 2 or worker 1. Both assignments lead to sum of the Manhattan distances as 4.
44+
</pre>
45+
46+
<p>&nbsp;</p>
47+
48+
<p><strong>Note:</strong></p>
49+
50+
<ol>
51+
<li><code>0 &lt;= workers[i][0], workers[i][1], bikes[i][0], bikes[i][1] &lt; 1000</code></li>
52+
<li>All worker and bike locations are distinct.</li>
53+
<li><code>1 &lt;= workers.length &lt;= bikes.length &lt;= 10</code></li>
54+
</ol>
1555

1656
### Related Topics
1757
[[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)]

‎problems/campus-bikes/README.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,47 @@
1111

1212
## 1057. Campus Bikes (Medium)
1313

14+
<p>On a campus represented as a 2D grid, there are <code>N</code> workers and <code>M</code> bikes, with <code>N &lt;= M</code>. Each worker and bike is a 2D coordinate on this grid.</p>
1415

16+
<p>Our goal is to assign a bike to each worker. Among the available bikes and workers, we choose the (worker, bike) pair with the shortest Manhattan distance between each other, and assign the bike to that worker. (If there are multiple (worker, bike) pairs with the same shortest Manhattan distance, we choose the pair with the smallest worker index; if there are multiple ways to do that, we choose the pair with the smallest bike index). We repeat this process until there are no available workers.</p>
17+
18+
<p>The Manhattan distance between two points <code>p1</code> and <code>p2</code> is <code>Manhattan(p1, p2) = |p1.x - p2.x| + |p1.y - p2.y|</code>.</p>
19+
20+
<p>Return a vector <code>ans</code> of length <code>N</code>, where <code>ans[i]</code> is the index (0-indexed) of the bike that the <code>i</code>-th worker is assigned to.</p>
21+
22+
<p>&nbsp;</p>
23+
24+
<p><strong>Example 1:</strong></p>
25+
26+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/06/1261_example_1_v2.png" style="width: 264px; height: 264px;" /></p>
27+
28+
<pre>
29+
<strong>Input: </strong>workers = <span id="example-input-1-1">[[0,0],[2,1]]</span>, bikes = <span id="example-input-1-2">[[1,2],[3,3]]</span>
30+
<strong>Output: </strong><span id="example-output-1">[1,0]</span>
31+
<strong>Explanation: </strong>
32+
Worker 1 grabs Bike 0 as they are closest (without ties), and Worker 0 is assigned Bike 1. So the output is [1, 0].
33+
</pre>
34+
35+
<p><strong>Example 2:</strong></p>
36+
37+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/06/1261_example_2_v2.png" style="width: 264px; height: 264px;" /></p>
38+
39+
<pre>
40+
<strong>Input: </strong>workers = <span id="example-input-2-1">[[0,0],[1,1],[2,0]]</span>, bikes = <span id="example-input-2-2">[[1,0],[2,2],[2,1]]</span>
41+
<strong>Output: </strong><span id="example-output-2">[0,2,1]</span>
42+
<strong>Explanation: </strong>
43+
Worker 0 grabs Bike 0 at first. Worker 1 and Worker 2 share the same distance to Bike 2, thus Worker 1 is assigned to Bike 2, and Worker 2 will take Bike 1. So the output is [0,2,1].
44+
</pre>
45+
46+
<p>&nbsp;</p>
47+
48+
<p><strong>Note:</strong></p>
49+
50+
<ol>
51+
<li><code>0 &lt;= workers[i][j], bikes[i][j] &lt; 1000</code></li>
52+
<li>All worker and bike locations are distinct.</li>
53+
<li><code>1 &lt;= workers.length &lt;= bikes.length &lt;= 1000</code></li>
54+
</ol>
1555

1656
### Related Topics
1757
[[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)]

‎problems/confusing-number/README.md‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,64 @@
1111

1212
## 1056. Confusing Number (Easy)
1313

14+
<p>Given a number <code>N</code>, return <code>true</code> if and only if it is a <em>confusing number</em>, which satisfies the following condition:</p>
1415

16+
<p>We can rotate digits by 180 degrees to form new digits. When 0, 1, 6, 8, 9 are rotated 180 degrees, they become 0, 1, 9, 8, 6 respectively. When 2, 3, 4, 5 and 7 are rotated 180 degrees, they become invalid. A <em>confusing number</em> is a number that when rotated 180 degrees becomes a <strong>different</strong> number with each digit valid.</p>
17+
18+
<p>&nbsp;</p>
19+
20+
<p><strong>Example 1:</strong></p>
21+
22+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/23/1268_1.png" style="width: 180px; height: 90px;" /></p>
23+
24+
<pre>
25+
<strong>Input: </strong><span id="example-input-1-1">6</span>
26+
<strong>Output: </strong><span id="example-output-1">true</span>
27+
<strong>Explanation: </strong>
28+
We get <code>9</code> after rotating <code>6</code>, <code>9</code> is a valid number and <code>9!=6</code>.
29+
</pre>
30+
31+
<p><strong>Example 2:</strong></p>
32+
33+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/23/1268_2.png" style="width: 180px; height: 90px;" /></p>
34+
35+
<pre>
36+
<strong>Input: </strong><span id="example-input-2-1">89</span>
37+
<strong>Output: </strong><span id="example-output-2">true</span>
38+
<strong>Explanation: </strong>
39+
We get <code>68</code> after rotating <code>89</code>, <code>86</code> is a valid number and <code>86!=89</code>.
40+
</pre>
41+
42+
<p><strong>Example 3:</strong></p>
43+
44+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/26/1268_3.png" style="width: 301px; height: 121px;" /></p>
45+
46+
<pre>
47+
<strong>Input: </strong><span id="example-input-3-1">11</span>
48+
<strong>Output: </strong><span id="example-output-3">false</span>
49+
<strong>Explanation: </strong>
50+
We get <code>11</code> after rotating <code>11</code>, <code>11</code> is a valid number but the value remains the same, thus <code>11</code> is not a confusing number.
51+
</pre>
52+
53+
<p><strong>Example 4:</strong></p>
54+
55+
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/03/23/1268_4.png" style="width: 180px; height: 90px;" /></p>
56+
57+
<pre>
58+
<strong>Input: </strong><span id="example-input-4-1">25</span>
59+
<strong>Output: </strong><span id="example-output-4">false</span>
60+
<strong>Explanation: </strong>
61+
We get an invalid number after rotating <code>25</code>.
62+
</pre>
63+
64+
<p>&nbsp;</p>
65+
66+
<p><strong>Note:</strong></p>
67+
68+
<ol>
69+
<li><code>0 &lt;= N &lt;= 10^9</code></li>
70+
<li>After the rotation we can ignore leading zeros, for example if after rotation we have <code>0008</code>&nbsp;then this number is considered as just <code>8</code>.</li>
71+
</ol>
1572

1673
### Related Topics
1774
[[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)]

‎problems/digit-count-in-range/README.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,37 @@
1111

1212
## 1067. Digit Count in Range (Hard)
1313

14+
Given an integer <code>d</code> between <code>0</code> and <code>9</code>, and two positive integers <code>low</code> and <code>high</code> as lower and upper bounds, respectively. Return the number of times that <code>d</code> occurs as a digit in all integers between <code>low</code> and <code>high</code>, including the bounds <code>low</code> and <code>high</code>.
15+
<p>&nbsp;</p>
1416

17+
<p><strong>Example 1:</strong></p>
18+
19+
<pre>
20+
<strong>Input: </strong>d = <span id="example-input-1-1">1</span>, low = <span id="example-input-1-2">1</span>, high = <span id="example-input-1-3">13</span>
21+
<strong>Output: </strong><span id="example-output-1">6</span>
22+
<strong>Explanation: </strong>
23+
The digit <code>d=1</code> occurs <code>6</code> times in <code>1,10,11,12,13</code>. Note that the digit <code>d=1</code> occurs twice in the number <code>11</code>.
24+
</pre>
25+
26+
<div>
27+
<p><strong>Example 2:</strong></p>
28+
29+
<pre>
30+
<strong>Input: </strong>d = <span id="example-input-2-1">3</span>, low = <span id="example-input-2-2">100</span>, high = <span id="example-input-2-3">250</span>
31+
<strong>Output: </strong><span id="example-output-2">35</span>
32+
<strong>Explanation: </strong>
33+
The digit <code>d=3</code> occurs <code>35</code> times in <code>103,113,123,130,131,...,238,239,243</code>.
34+
</pre>
35+
36+
<p>&nbsp;</p>
37+
38+
<p><strong>Note:</strong></p>
39+
40+
<ol>
41+
<li><code>0 &lt;= d &lt;= 9</code></li>
42+
<li><code>1 &lt;= low &lt;= high &lt;= 2&times;10^8</code></li>
43+
</ol>
44+
</div>
1545

1646
### Related Topics
1747
[[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)]

‎problems/fixed-point/README.md‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,45 @@
1111

1212
## 1064. Fixed Point (Easy)
1313

14+
<p>Given an array <code>A</code> of distinct integers sorted in ascending order, return the smallest index <code>i</code> that satisfies <code>A[i] == i</code>.&nbsp; Return <code>-1</code> if no such <code>i</code> exists.</p>
1415

16+
<p>&nbsp;</p>
17+
18+
<p><strong>Example 1:</strong></p>
19+
20+
<pre>
21+
<strong>Input: </strong><span id="example-input-1-1">[-10,-5,0,3,7]</span>
22+
<strong>Output: </strong><span id="example-output-1">3</span>
23+
<strong>Explanation: </strong>
24+
For the given array, <code>A[0] = -10, A[1] = -5, A[2] = 0, A[3] = 3</code>, thus the output is 3.
25+
</pre>
26+
27+
<p><strong>Example 2:</strong></p>
28+
29+
<pre>
30+
<strong>Input: </strong><span id="example-input-2-1">[0,2,5,8,17]</span>
31+
<strong>Output: </strong><span id="example-output-2">0</span>
32+
<strong>Explanation: </strong>
33+
<code>A[0] = 0</code>, thus the output is 0.
34+
</pre>
35+
36+
<p><strong>Example 3:</strong></p>
37+
38+
<pre>
39+
<strong>Input: </strong><span id="example-input-3-1">[-10,-5,3,4,7,9]</span>
40+
<strong>Output: </strong><span id="example-output-3">-1</span>
41+
<strong>Explanation: </strong>
42+
There is no such <code>i</code> that <code>A[i] = i</code>, thus the output is -1.
43+
</pre>
44+
45+
<p>&nbsp;</p>
46+
47+
<p><strong>Note:</strong></p>
48+
49+
<ol>
50+
<li><code>1 &lt;= A.length &lt; 10^4</code></li>
51+
<li><code>-10^9 &lt;= A[i] &lt;= 10^9</code></li>
52+
</ol>
1553

1654
### Related Topics
1755
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]

‎problems/greatest-common-divisor-of-strings/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
[Next >](https://github.com/openset/leetcode/tree/master/problems/flip-columns-for-maximum-number-of-equal-rows "Flip Columns For Maximum Number of Equal Rows")
1111

12-
## 1071. Greatest Common Divisor of Strings (Easy)
12+
## 5076. Greatest Common Divisor of Strings (Easy)
1313

1414
<p>For 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</code>&nbsp; (<code>T</code> concatenated with itself 1 or more times)</p>
1515

0 commit comments

Comments
(0)

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