Find maximum length of good path in a grid
问题 Given is a N*N grid.Now we need to find a good path of maximum length , where good path is defined as follow : Good path always start from a cell marked as 0 We are only allowed to move Left,Right,Up Or Down If the value of ith cell is say A, then value of next cell in the path must be A+1. Now given these few conditions, I need to find out the length of maximum path that can be made. Also I need to count such paths that are of maximum length. Example : Let N=3 and we have 3*3 matrix as