human
Number of ways to reach ( M , N ) in a matrix starting from the origin without visiting ( X , Y ) | Function for computing nCr.
Function to find factorial of a number.
Function for counting the number of ways to reach ( m , n ) without visiting ( x , y ).
Given dimensions of Matrix.
Cell not to be visited.
Function call"
Solution in Python:
assistant
#Here is code to number of ways to reach ( M , N ) in a matrix starting from the origin without visiting ( X , Y ) and the other steps required.
 def nCr ( n , r ) :
	return ( fact ( n ) // ( fact ( r ) * fact ( n - r ) ) )
def fact ( n ) :
	res = 1
	for i in range ( 2 , n + 1 ) :
		res = res * i
	return res
def countWays ( m , n , x , y ) :
	return ( nCr ( m + n , m ) - nCr ( x + y , x ) * nCr ( m + n - x - y , m - x ) )
m = 5
n = 4
x = 3
y = 2
print ( countWays ( m , n , x , y ) )