ways_left if = else compute_number_of_ways_to_xy (xy number_of_ways [ ][yways_top ways_left return number_of_ways [ ][ynumber_of_ways [[ for in range( )return compute_number_of_ways_to_xy ( the time complexity is (nm)and the space complexity is (nm)where is the number of rows and is the number of columns figure the number of ways to get from ( to (ijfor <ij < more analytical way of solving this problem is to use the fact that each path from ( to ( is sequence of horizontal steps and vertical steps there are + - - ( + - ) + - ( - )!( - )such paths - variantsolve the same problem using (min(nm)space variantsolve the same problem in the presence of obstaclesspecified by boolean arraywhere the presence of true value represents an obstacle varianta fisherman is in rectangular sea the value of the fish at point (ijin the sea is specified by an array write program that computes the maximum value of fish fisherman can catch on path from the upper leftmost point to the lower rightmost point the fisherman can only move down or rightas illustrated in figure figure alternate paths for fisherman different types of fish have different valueswhich are known to the fisherman variantsolve the same problem when the fisherman can begin and end at any point he must still move down or right (note that the value at (ijmay be negative