Minimum Falling Path Sum - Leetcode 931 - Python

  Рет қаралды 13,005

NeetCodeIO

NeetCodeIO

Күн бұрын

🚀 neetcode.io/ - A better way to prepare for Coding Interviews
🧑‍💼 LinkedIn: / navdeep-singh-3aaa14161
🐦 Twitter: / neetcode1
⭐ BLIND-75 PLAYLIST: • Two Sum - Leetcode 1 -...
Problem Link: leetcode.com/problems/minimum...
0:00 - Read the problem
0:30 - Recursive Explanation
3:35 - Recursive Coding
8:00 - DP Explanation
10:42 - DP Coding
leetcode 931
#neetcode #leetcode #python

Пікірлер: 29
@user-pv4xn3sg7j
@user-pv4xn3sg7j 5 ай бұрын
Missed your daily videos bro.
@runabishek
@runabishek 5 ай бұрын
Please don't skip posting videos😅
@dingus2332
@dingus2332 5 ай бұрын
To be fair , questions asked in that time frame , were not that deep
@surajmandal_567
@surajmandal_567 5 ай бұрын
Let's write some more neetcode 🎉.
@tekfoonlim4745
@tekfoonlim4745 5 ай бұрын
I use subtitles always.. and it gives let's write some neat code 😂😂
@MP-ny3ep
@MP-ny3ep 5 ай бұрын
Great explanation as always. Thank you very much.
@shashankgupta5192
@shashankgupta5192 5 ай бұрын
Finally you are back!!❤
@aksharpathak5226
@aksharpathak5226 5 ай бұрын
thanks bro for uploading the video.......I thought you stopped solving leetcode
@rahulchauhan.
@rahulchauhan. 5 ай бұрын
One can adapt this problem to find the maximum falling path too!
@ahmedtremo
@ahmedtremo 5 ай бұрын
Welcome back :D
@mrgeorgy93
@mrgeorgy93 5 ай бұрын
I got my Amazon offer yesterday, largerly thanks to your channel!
@NeetCodeIO
@NeetCodeIO 5 ай бұрын
HAPPY FOR YOU ❤️🚀🔥
@LeetCodeUzbekistan
@LeetCodeUzbekistan 5 ай бұрын
bro in the moring I looked for your video, I could solve this by my own and then you publishing this video which is the exact same algorithm 😅
@dumbfailurekms
@dumbfailurekms 5 ай бұрын
sometimes u are literally the only light in my eternal dark hell
@Dancedfsk8
@Dancedfsk8 5 ай бұрын
Finally!
@Pegasus02Kr
@Pegasus02Kr 5 ай бұрын
Is it truly a solution for medium difficulty problem? was much harder to understand than most of hard problem for me..
@imretakacs8952
@imretakacs8952 5 ай бұрын
At line 8, should not that be c >= 0 instead of c > 0.
@justintang6313
@justintang6313 5 ай бұрын
Is the DP solution top-down or bottom-up?
@Itachi-mr8nj
@Itachi-mr8nj 5 ай бұрын
Bro is gonna pretend like he didn't go missing for a few days
@alviahmed7388
@alviahmed7388 5 ай бұрын
When will you stream next?
@mikerico6175
@mikerico6175 5 ай бұрын
Could do += line 10 and use inf instead of float(“inf”)
@phatboislym
@phatboislym 5 ай бұрын
what is "line 10"?
@mikerico6175
@mikerico6175 5 ай бұрын
@@phatboislymmatrix[r][c] = matrix[r][c] + …. instead just do matrix[r][c] +=
@user-vs1jd4kp4h
@user-vs1jd4kp4h 5 ай бұрын
@@phatboislym you can avoid by managing index inside the indexing as well like this: I used extra dp matrix but you can use the same input array to do this as well def minFallingPathSum(self, matrix: List[List[int]]) -> int: m, n = len(matrix), len(matrix[0]) dp = [[0 for _ in range(n)] for _ in range( m+1)] for i in range(m-1, -1, -1): for j in range(n): dp[i][j] =min(matrix[i][j]+dp[i+1][max(0,j-1)], matrix[i][j]+dp[i+1][j], matrix[i][j]+ dp[i+1][min(n-1,j+1)]) return min(dp[0])
@XEQUTE
@XEQUTE 5 ай бұрын
Please do daily neetcode problems or update the community posts with links to earlier solved problems please I do not want to watch any other channel
@NeetCodeIO
@NeetCodeIO 5 ай бұрын
Sure, will do!
@user-sj1fk4vs3n
@user-sj1fk4vs3n 5 ай бұрын
why i am getting tle??? class Solution { public int minFallingPathSum(int[][] matrix) { int n=matrix.length,m=matrix[0].length; int min=Integer.MAX_VALUE; int dp[][]=new int[n][m]; for(int row[]:dp) { Arrays.fill(row,-1); } for(int i=0;i
@elyababakova2125
@elyababakova2125 5 ай бұрын
A nice problem to revise classic DP solutions. Thanks for video, I was missing your daily solutions! BTW @NeetCodeIO, I wonder wether you've bought a leetcode T-Shirt for leetcoins? :)
@aksimsons
@aksimsons 5 ай бұрын
Anyone getting TLE for running recursive solution in Java? This is my code:- class Solution { public int dfs(int row,int column,int[][] matrix,HashMap s){ int n=matrix.length; if(row==n ) return 0; if(column==n || column
Out of Boundary Paths - Leetcode 576 - Python
18:20
NeetCodeIO
Рет қаралды 15 М.
Sum of Subarray Minimums - Leetcode 907 - Python
18:51
NeetCodeIO
Рет қаралды 29 М.
Happy 4th of July 😂
00:12
Pink Shirt Girl
Рет қаралды 32 МЛН
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 49 МЛН
THE POLICE TAKES ME! feat @PANDAGIRLOFFICIAL #shorts
00:31
PANDA BOI
Рет қаралды 24 МЛН
I Can't Believe We Did This...
00:38
Stokes Twins
Рет қаралды 82 МЛН
931. Minimum Falling Path Sum | LEETCODE MEDIUM | DYNAMIC PROGRAMMING
9:05
Subarray Sums Divisible by K - Leetcode 974 - Python
16:41
NeetCodeIO
Рет қаралды 12 М.
Maximum Total Importance of Roads - Leetcode 2285 - Python
9:59
Sequential Digits - Leetcode 1291 - Python
15:02
NeetCodeIO
Рет қаралды 12 М.
Bitwise AND of Numbers Range - Leetcode 201 - Python
18:25
NeetCodeIO
Рет қаралды 12 М.
You WILL Understand Recursion After Watching This
3:46
LeetCode 55. Jump Game (Algorithm Explained)
10:06
Nick White
Рет қаралды 76 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
Unique Paths II - Leetcode 63 - Python
14:31
NeetCodeIO
Рет қаралды 13 М.
Happy 4th of July 😂
00:12
Pink Shirt Girl
Рет қаралды 32 МЛН