File tree 1 file changed +0
-24
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 1071. Greatest Common Divisor of Strings
5
- *
6
- * For strings S and T, we say "T divides S" if and only if S = T + ... + T (T concatenated with itself 1 or more times)
7
- * Return the largest string X such that X divides str1 and X divides str2.
8
- *
9
- * Example 1:
10
- * Input: str1 = "ABCABC", str2 = "ABC"
11
- * Output: "ABC"
12
- *
13
- * Example 2:
14
- * Input: str1 = "ABABAB", str2 = "ABAB"
15
- * Output: "AB"
16
- *
17
- * Example 3:
18
- * Input: str1 = "LEET", str2 = "CODE"
19
- * Output: ""
20
- *
21
- * Note:
22
- *
23
- * 1 <= str1.length <= 1000
24
- * 1 <= str2.length <= 1000
25
- * str1[i] and str2[i] are English uppercase letters.
26
- * */
27
3
public class _1071 {
28
4
public static class Solution1 {
29
5
public String gcdOfStrings (String str1 , String str2 ) {
You can’t perform that action at this time.
0 commit comments