longestIncreasingPath = (matrix, maxPath = 0, memo = initMemo(matrix)) => {
    const [ rows, cols ] = [ matrix.length, matrix[0].length ];

    for (let row = 0; row < rows; row++) {/* Time O(N) */
        for (let col = 0; col < cols; col++) {/* Time O(M) */
            const path =                  /* Time O(N * M) | Space O((N * M) + HEIGHT) */
                search(matrix, row, rows, col, cols, memo);

            maxPath = Math.max(maxPath, path);
        }
    }

    return maxPath;
}
DP - Top Down
Matrix - Memoization
Time O(N * M) | Space O(N * M)
https://leetcode.com/problems/longest-increasing-path-in-a-matrix/
@param {number[][]} matrix
@return {number}