human
Check if row | Function to check if row - major order traversal of the matrix is is palindrome.
Loop to check if the matrix is matrix is palindrome or not.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to check if row and the other steps required.
 def isPal ( a , n , m ) :
	for i in range ( 0 , n // 2 ) :
		for j in range ( 0 , m - 1 ) :
			if ( a [ i ] [ j ] != a [ n - 1 - i ] [ m - 1 - j ] ) :
				return False ;
	return True ;
if __name__ == ' _ _ main _ _ ' :
	n = 3 ;
	m = 3 ;
	a = [ [ 1 , 2 , 3 ] , [ 4 , 5 , 4 ] , [ 3 , 2 , 1 ] ] ;
	if ( isPal ( a , n , m ) ) :
		print ( " YES " ) ;
	else :
		print ( " NO " ) ;