Thursday, 13 December 2018

Interview problem #1 (possible path in a matrix)

Count all possible paths from top left to bottom right of a mXn matrix and the constraint is that you can only move right and bottom.


Test Cases:

1) m=2,n=2
output=2

2) m=3,n=3
output=6

3) m=5,n=5
output=70

please suggest solution to this problem.

No comments:

Post a Comment

Dynamic programming problem

Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below binary matrix. Please...