human
Write me a code to number of shortest paths to reach every cell from bottom and the other steps required given the following:
Number of shortest paths to reach every cell from bottom | Function to find number of shortest paths.
Compute the grid starting from the bottom - left corner.
Print the grid.
Driver code.
Function call"
Solution in Python:
assistant
#Here is code to number of shortest paths to reach every cell from bottom and the other steps required.
 def NumberOfShortestPaths ( n , m ) :
	a = [ [ 0 for i in range ( m ) ] for j in range ( n ) ]
	for i in range ( n ) :
		for j in range ( m ) :
			a [ i ] [ j ] = 0
	i = n - 1
	while ( i >= 0 ) :
		for j in range ( m ) :
			if ( j == 0 or i == n - 1 ) :
				a [ i ] [ j ] = 1
			else :
				a [ i ] [ j ] = a [ i ] [ j - 1 ] + a [ i + 1 ] [ j ]
		i -= 1
	for i in range ( n ) :
		for j in range ( m ) :
			print ( a [ i ] [ j ] , end = " ▁ " )
		print ( " " , ▁ end ▁ = ▁ " " )
if __name__ == ' _ _ main _ _ ' :
	n = 5
	m = 2
	NumberOfShortestPaths ( n , m )