Unique Paths | LeetCode 62 | C++, Java, Python

preview_player
Показать описание

**** Best Books For Data Structures & Algorithms for Interviews:**********
*****************************************************************************

June LeetCoding Challenge | Problem 29 | Unique Paths | 29 June,
Facebook Coding Interview question,
google coding interview question,
leetcode,
Unique Paths,
Unique Paths c++,
Unique Paths Java,
Unique Paths python,
Unique Paths solution,
62. Unique Paths,

#Facebook #CodingInterview #LeetCode #JuneLeetCodingChallenge #Google #Amazon #DynamicProgramming #Dp #UniquePaths
Рекомендации по теме
Комментарии
Автор

Your channel reach should be high
Also you are coding in 3 languages

midhileshmomidi
Автор

How about this one !
return

Basically arranging arranging m-1 and n-1 similar items !! (m+n-2)!/(n-1)!(m-1)!

digantgupta
Автор

Your drawings are perfect. Thank you very much! If problem asks for "Find minimum number, maximum number of possible solutions" it is usually DP right?

Also could you see if my approach is OK too?

public int uniquePaths(int m, int n) {
int[][] dp = new int[m][n];
dp[0][0] = 1;

for (int row = 0; row < m; row++) {
for (int col = 0; col < n; col++) {
if (row > 0) dp[row][col] += dp[row - 1][col];
if (col > 0) dp[row][col] += dp[row][col - 1];
}
}
return dp[m - 1][n - 1];
}

cloud
Автор

Any tips on how you have learned all the three languages?

vinoddiwan
join shbcf.ru