Problem

Given a 2D array A[M][N], aka Grid / Maze / Matrix

Write an algorithm to count the number of unique paths to reach to A[M-1][N-1] from A[0][0]

Example

Input A[3][3]

Expected output 6

Dynamic programming bottom-up approach