human
Final direction after visiting every cell of Matrix starting from ( 0 , 0 ) | Function to find the direction when stopped moving.
Given size of NxM grid.
Function Call"
How can the above be solved in Python?
 ... Write me a code to final direction after visiting every cell of Matrix starting from ( 0 , 0 ) and the other steps required?
assistant
#Here is code to final direction after visiting every cell of Matrix starting from ( 0 , 0 ) and the other steps required.
 def findDirection ( n , m ) :
	if ( n > m ) :
		if ( m % 2 == 0 ) :
			print ( " Up " ) ;
		else :
			print ( " Down " ) ;
	else :
		if ( n % 2 == 0 ) :
			print ( " Left " ) ;
		else :
			print ( " Right " ) ;
n = 3 ; m = 3 ;
findDirection ( n , m ) ;