added
parent
75f0b66e63
commit
2d86df57a2
|
@ -35,3 +35,7 @@ int main() {
|
||||||
|
|
||||||
cout<<minSumPath(n,m,matrix);
|
cout<<minSumPath(n,m,matrix);
|
||||||
}
|
}
|
||||||
|
// Time Complexity: O(N*M)
|
||||||
|
// Space Complexity: O((M-1)+(N-1)) + O(N*M)
|
||||||
|
// example : N=2,M=3
|
||||||
|
// Min pathsum = 5+9+6+2 =21
|
|
@ -44,3 +44,7 @@ int main() {
|
||||||
|
|
||||||
cout<<countWays(m,n);
|
cout<<countWays(m,n);
|
||||||
}
|
}
|
||||||
|
// Time Complexity: O(M*N)
|
||||||
|
// Space Complexity: O(M*N)
|
||||||
|
// example : M=3,N=2
|
||||||
|
// Unique paths = 3
|
Loading…
Reference in New Issue