human
Minimum characters to be deleted from the beginning of two strings to make them equal | Function that finds minimum character required to be deleted.
Iterate in the strings.
Check if the characters are not equal.
Return the result.
Driver code"
How can the above be solved in Python?
 ... Give me a code to minimum characters to be deleted from the beginning of two strings to make them equal and the other steps required?
assistant
#Here is code to minimum characters to be deleted from the beginning of two strings to make them equal and the other steps required.
 def minDel ( s1 , s2 ) :
	i = len ( s1 )
	j = len ( s2 )
	while ( i > 0 and j > 0 ) :
		if ( s1 [ i - 1 ] != s2 [ j - 1 ] ) :
			break
		i -= 1
		j -= 1
	return i + j
if __name__ == ' _ _ main _ _ ' :
	s1 = " geeksforgeeks "
	s2 = " peeks "
	print ( minDel ( s1 , s2 ) )