public class Solution {

```
public int uniquePaths(int m, int n) {
int min = Math.min(m,n);
int max = Math.max(m,n);
int[] dp = new int[min];
dp[0] = 1;
for (int i = 1; i< m + n-1; i++) {
for (int j = min-1;j> 0; j--) {
dp[j] += dp[j-1];
}
}
return dp[min-1];
}
```

}