Closed shawfire closed 1 month ago
Winston Tang commented: Hello shaw_fire,
Thank you for reaching out! Based on the problem statement, the greatest common divisor of the strings is defined as the longest string which, when repetitively concatenated, can yield (or "divide") the entirety of both original strings.
While "TAUXXTAUXXTAUXX" does repeat within the larger string, it doesn't cover the entirety of the shorter string ("TAUXXTAUXXTAUXXTAUXXTAUXX"). However, "TAUXX", does, making it the correct answer according to the identified constraints of this problem.
Please reread the constraints of the problem, and carefully check the definition and requirements of the greatest common divisor of the strings in the context of the problem. If you need further assistance, you can explore tutorials or discuss the issue on the LeetCode discussion forums.
Best Regards, LeetCode Support Team
LeetCode Username
shaw_fire
Problem Number, Title, and Link
1071, Greatest Common Divisor of Strings https://leetcode.com/problems/greatest-common-divisor-of-strings
Bug Category
Incorrect test case (Output of test case is incorrect as per the problem statement)
Bug Description
I think this test case is incorrect: str1 = "TAUXXTAUXXTAUXXTAUXXTAUXX" str2 = "TAUXXTAUXXTAUXXTAUXXTAUXXTAUXXTAUXXTAUXXTAUXX" Expected = "TAUXX" In my opinion "TAUXXTAUXXTAUXX" is the expect greatest common divisor not "TAUXX" Below alignment shows that "TAUXXTAUXXTAUXX" is the largest common divisor:
Please correct me if I have an incorrect understanding of this problem.
Language Used for Code
JavaScript
Code used for Submit/Run operation
Expected behavior
I think this test case is incorrect: str1 = "TAUXXTAUXXTAUXXTAUXXTAUXX" str2 = "TAUXXTAUXXTAUXXTAUXXTAUXXTAUXXTAUXXTAUXXTAUXX" Expected = "TAUXX" In my opinion "TAUXXTAUXXTAUXX" is the expect greatest common divisor not "TAUXX" Below alignment shows that "TAUXXTAUXXTAUXX" is the largest common divisor:
Please correct me if I have an incorrect understanding of this problem.
Screenshots
No response
Additional context
No response