Java Solution, 0 ms, Beats 100%
Code\n\nclass Solution {\n    public int uniquePathsWithObstacles(int[][] OG) {\n        if (OG[0][0] == 1) return 0;\n        int m = OG.length, n = OG[0].leng
# Code\n```\nclass Solution {\n    public int uniquePathsWithObstacles(int[][] OG) {\n        if (OG[0][0] == 1) return 0;\n        int m = OG.length, n = OG[0].length;\n        int[][] dp = new int[m][n];\n        dp[0][0] = 1;\n        for (int i = 0; i < m; i++)\n            for (int j = 0; j < n; j++)\n                if (OG[i][j] == 1 || (i == 0 && j == 0)) continue;\n                else dp[i][j] = (i > 0 ? dp[i-1][j] : 0) + (j > 0 ? dp[i][j-1] : 0);\n        return dp[m-1][n-1];\n    }\n}\n```
['Array', 'Dynamic Programming', 'Matrix', 'Java']