```
class Solution {
private:
int lookup[101][101];
int recurse(int m, int n) {
if(lookup[m][n] == -1) {
if(m==1) return 1;
if(n==1) return 1;
lookup[m][n] = uniquePaths(m-1,n) + uniquePaths(m,n-1);
}
return lookup[m][n];
}
public:
int uniquePaths(int m, int n) {
memset(lookup,-1,sizeof(lookup));
return recurse(m,n);
}
};
```