human
Check whether two strings contain same characters in same order | Python3 implementation of the approach.
string class has a constructor that allows us to specify the size of string as first parameter and character to be filled in given size as the second parameter ..
Function that returns true if the given strings contain same characters in same order.
Get the first character of both strings.
Now if there are adjacent similar character remove that character from s1.
Now if there are adjacent similar character remove that character from s2.
If both the strings are equal then return true.
Driver code"
Solution in Python:
 ... What is a code to check whether two strings contain same characters in same order and the other steps required?
assistant
#Here is code to check whether two strings contain same characters in same order and the other steps required.
 def getString ( x ) :
	return x
def solve ( s1 , s2 ) :
	a = getString ( s1 [ 0 ] )
	b = getString ( s2 [ 0 ] )
	for i in range ( 1 , len ( s1 ) ) :
		if s1 [ i ] != s1 [ i - 1 ] :
			a += getString ( s1 [ i ] )
	for i in range ( 1 , len ( s2 ) ) :
		if s2 [ i ] != s2 [ i - 1 ] :
			b += getString ( s2 [ i ] )
	if a == b :
		return True
	return False
s1 = " Geeks "
s2 = " Geks "
if solve ( s1 , s2 ) :
	print ( " Yes " )
else :
	print ( " No " )