human
Number of common base strings for two strings | function for finding common divisor ..
Checking if ' base ' is base string of 's1.
Checking if ' base ' is base string of 's2.
Driver code"
Solution in Python:
 Give me a code to number of common base strings for two strings and the other steps required?
assistant
#Here is code to number of common base strings for two strings and the other steps required.
 def isCommonBase ( base , s1 , s2 ) :
'
	for j in range ( len ( s1 ) ) :
		if ( base [ j % len ( base ) ] != s1 [ j ] ) :
			return False
'
	for j in range ( len ( s2 ) ) :
		if ( base [ j % len ( base ) ] != s2 [ j ] ) :
			return False
	return True
def countCommonBases ( s1 , s2 ) :
	n1 = len ( s1 )
	n2 = len ( s2 )
	count = 0
	for i in range ( 1 , min ( n1 , n2 ) + 1 ) :
		base = s1 [ 0 : i ]
		if ( isCommonBase ( base , s1 , s2 ) ) :
			count += 1
	return count
if __name__ == " _ _ main _ _ " :
	s1 = " pqrspqrs "
	s2 = " pqrspqrspqrspqrs "
	print ( countCommonBases ( s1 , s2 ) )