class Solution {
public:
int uniquePaths(int m, int n) {
int array[m][n];
for( int i = 0 ; i < m ; i++ ) {
for( int j = 0 ; j < n ; j++ ) {
if( i == 0 || j == 0 ) {
array[i][j] = 1;
}
else {
array[i][j] = array[i-1][j] + array[i][j-1];
}
}
}
return array[m-1][n-1];
}
};
System Design for Beginners
A masterclass that helps early engineers and product managers become great at designing scalable systems.
132+ learners
Details →System Design Masterclass
A masterclass that helps you become great at designing scalable, fault-tolerant, and highly available systems.
1000+ learners
Details →Redis Internals
Learn internals of Redis by re-implementing some of the core features in Golang.
98+ learners
Details →