human
Delete consecutive same words in a sequence | Function to find the size of manipulated sequence.
Start traversing the sequence.
Compare the current string with next one Erase both if equal.
Erase function delete the element and also shifts other element that 's why   i is not updated .
Update i , as to check from previous element again.
Reduce sequence size.
Increment i , if not equal.
Return modified size.
Driver Code"
Solution in Python:

What is a code to delete consecutive same words in a sequence and the other steps required?
assistant
#Here is code to delete consecutive same words in a sequence and the other steps required.
 def removeConsecutiveSame ( v ) :
	n = len ( v )
	i = 0
	while ( i < n - 1 ) :
		if ( ( i + 1 ) < len ( v ) ) and ( v [ i ] == v [ i + 1 ] ) :
			v = v [ : i ]
			v = v [ : i ]
			if ( i > 0 ) :
				i -= 1
			n = n - 2
		else :
			i += 1
	return len ( v [ : i - 1 ] )
if __name__ == ' _ _ main _ _ ' :
	v = [ " tom " , " jerry " , " jerry " , " tom " ]
	print ( removeConsecutiveSame ( v ) )