human
Find the GCD of an array made up of numeric strings | Recursive function to return gcd of A and B.
Base case.
Length of A is greater.
Calculate GCD.
Store the GCD of the length of the strings.
Driver Code.
Function call"
Solution in Python:
assistant
#Here is code to find the GCD of an array made up of numeric strings and the other steps required.
 def GCD ( lena , lenb ) :
	if ( lena == 0 ) :
		return lenb
	if ( lenb == 0 ) :
		return lena
	if ( lena == lenb ) :
		return lena
	if ( lena > lenb ) :
		return GCD ( lena - lenb , lenb )
	return GCD ( lena , lenb - lena )
def StringGCD ( a , b ) :
	gcd = GCD ( len ( a ) , len ( b ) )
	if a [ : gcd ] == b [ : gcd ] :
		if a * ( len ( b ) // gcd ) == b * ( len ( a ) // gcd ) :
		return a [ : gcd ]
	return - 1
a = ' geeksgeeks '
b = ' geeks '
print ( StringGCD ( a , b ) )