human
Check if a grid can become row | v [ ] is vector of strings . len is length of strings in every row ..
Driver code.
l = 5 Length of strings"
Solution in Python:
 Give me a code to check if a grid can become row and the other steps required?
assistant
#Here is code to check if a grid can become row and the other steps required.
 def check ( v , l ) :
	n = len ( v )
	for i in v :
		i = ' ' . join ( sorted ( i ) )
	for i in range ( l - 1 ) :
		for j in range ( n ) :
			if ( v [ i ] [ j ] > v [ i + 1 ] [ j ] ) :
				return False
	return True
v = [ " ebcda " , " ihgfj " , " klmno " , " pqrst " , " yvwxu " ]
if check ( v , l ) :
	print " Yes "
else :
	print " No "