#1071

Greatest Common Divisor of Strings

pupil · 445 · lc easy +26 · 53.5% accepted · 5,996 likes · top 45%

Description

String t divides string s if s is formed by concatenating t with itself one or more times.

Given str1 and str2, return the longest string x such that x divides both str1 and str2.

Code

1
2
3