Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Greatest Common Divisor of Strings
Bookmark
Input
Standard
Longer GCD
No GCD
Single Char
Equal
Custom
str1
=
ABCABC
,
str2
=
ABC
str1
A
B
C
A
B
C
str2
A
B
C
A divisor string must tile both str1 and str2
algo
master
.
io
Step:
Start: find the GCD string of "ABCABC" and "ABC"
0 / 6
Input
Standard
Longer GCD
No GCD
Single Char
Equal
Custom
str1
=
ABCABC
,
str2
=
ABC
0 / 6
str1
A
B
C
A
B
C
str2
A
B
C
A divisor string must tile both str1 and str2
algo
master
.
io
Step:
Start: find the GCD string of "ABCABC" and "ABC"