fork download
  1. class Solution:
  2. def gcdOfStrings(self, s1: str, s2: str) -> str:
  3. if s1 + s2 != s2 + s1:
  4. return ""
  5.  
  6. mx_len = gcd(len(s1), len(s2))
  7. return s1[:mx_len]
Success #stdin #stdout 0.1s 14092KB
stdin
Standard input is empty
stdout
Standard output is empty