public static int UniquePathWithObstacleDP1D(int[][] obstacleGrid) {
		int m = obstacleGrid.length;
		int n = obstacleGrid[0].length;
		int[] sum = new int[n];
		if (obstacleGrid[0][0] == 1) {
			return 0;
		}
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < n; j++) {
				if (obstacleGrid[i][j] == 1) {
					sum[j] = 0;
				} else {
					if (i == 0 && j == 0) {
						sum[0] = 1;
					} else if (j == 0) {
						sum[j] = sum[j];
					} else {
						sum[j] = sum[j - 1] + sum[j];
					}
				}
			}
		}
		return sum[n - 1];
	}