Unique Paths | Dynamic programming | Leetcode #62

preview_player
Показать описание
This video explains an important dynamic programming interview problem which is to count all possible unique paths to reach from first cell to the last cell in a grid.We can solve this problem simply by using recursion but it is a costly process in terms of time.We can improve recursive solution by using a
lookup table which is called memoization.The most optimal approach is to solve using tabulation dynamic programming approach.I have shown the TOP-DOWN dynamic programming approach.I have explained the entire problem step by step by using proper examples and intuition for each step.I have dry run the algorithm and have also explained the code walk through at the end of the video.CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

=================================================================
=================================================================

OTHER PROBLEMS:-
Рекомендации по теме
Комментарии
Автор

Somebody give this man a medal ASAP. Crystal clear explanations on each and every problem. Very Inspiring and Helpful.

saurabhsomani
Автор

Everyone starts with matrix directly no one says why this would work. this Man is someone who tells the exact logic behind it. Great work Mate ...

dumbcurious
Автор

Its been 10 months and this Guy still hasn't received a medal!!!! You deserve it man! Thanks for explaining this nicely.

rahulbawa
Автор

This is how a coding problem should be Everybody needs to learn from this man right Hats off🎉🎉

savvy
Автор

I like Your Dark theme in the videos which gives my eyes the power to view more.

VrickzGamer
Автор

This man is so good at segementing the problems ! More power to you bro! A Die hard fan of you bro 💗

thiyagarajanr
Автор

Salute to ANYONE who gets this interview question and solves it within half n hr

venkateshmusuvathi
Автор

I have already solved this problem 2 months back, hence I copied my code from there. It was bottom up approach. Good to know about the top down approach.

sudhanshukumar
Автор

The Explanation is soo great....just came through an one line python solution.
return

maansi
Автор

You are way underrated for your work. Thanks for the solutions!

rutachaudhari
Автор

By combinatorics its like
(m+n-2)C(n-1). An better SC approach though!!

rogerknight
Автор

Mind-blowing Explanation
I am a fan of the way you think and solve the problem bro

md_aaqil
Автор

The best explanation, you deserve 1 Million subscriber .

adityagoswami
Автор

Most underrated channel ! Hatsoff to you brother !

HemanthaKumarYadav
Автор

Sucessfully completed. Thanks for this workout

hariprakash
Автор

You can minimise the space complexity to O(M). Following is the Golang code:
func uniquePaths(m int, n int) int {
grid := make([]int, m)
for i := 0; i < n; i++ {
for j := 0; j < m; j++ {
if i == 0 || j == 0 {
grid[j] = 1
} else {
grid[j] = grid[j] + grid[j-1]
}
}
}

return grid[m-1]
}

RohitSubedi
Автор

Start watching at 10:40. Great stuff btw, thanks for this.

ashishupadhyay
Автор

This universe needs people like him!! Protect him :)

lavanya_m
Автор

Best explanation for the unique paths problem.

aminumado
Автор

Can't thank you enough, I was stuck for hours with this approach. Now I understand it completely.

Ayush-xxbx