public static int uniquePaths(int m, int n) {
    	int[][] path = new int[m][n];
    	for (int i = 0; i < m; i++) {
    		for (int j = 0; j < n; j++) {
    			if (0 == i && 0 == j) path[i][j] = 1;
    			else if (0 == i) path[i][j] = path[0][j - 1];
    			else if (0 == j) path[i][j] = path[i - 1][0];
    			else path[i][j] = path[i][j - 1] + path[i - 1][j];
    		}
    	}
        return path[m - 1][n - 1];
    }