public int uniquePaths(int[][] obstacleGrid, int m, int n, int[][] memo){
        if(m < 0 || n < 0 || obstacleGrid[m][n] == 1) return 0;

        if(memo[m][n] == -1){
            memo[m][n] = uniquePaths(obstacleGrid, m - 1, n, memo) + uniquePaths(obstacleGrid, m, n - 1, memo);
        }
        return memo[m][n];
    }