Minimum Falling Path Sum - Leetcode 931 - Python

  Рет қаралды 14,550

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 30
@MrSkyS-i5v
@MrSkyS-i5v 11 ай бұрын
Missed your daily videos bro.
@surajmandal_567
@surajmandal_567 11 ай бұрын
Let's write some more neetcode 🎉.
@tekfoonlim4745
@tekfoonlim4745 11 ай бұрын
I use subtitles always.. and it gives let's write some neat code 😂😂
@runabishek
@runabishek 11 ай бұрын
Please don't skip posting videos😅
@dingus2332
@dingus2332 11 ай бұрын
To be fair , questions asked in that time frame , were not that deep
@shashankgupta5192
@shashankgupta5192 11 ай бұрын
Finally you are back!!❤
@MP-ny3ep
@MP-ny3ep 11 ай бұрын
Great explanation as always. Thank you very much.
@mrgeorgy93
@mrgeorgy93 11 ай бұрын
I got my Amazon offer yesterday, largerly thanks to your channel!
@NeetCodeIO
@NeetCodeIO 11 ай бұрын
HAPPY FOR YOU ❤️🚀🔥
@dumbfailurekms
@dumbfailurekms 11 ай бұрын
sometimes u are literally the only light in my eternal dark hell
@LeetCodeUzbekistan
@LeetCodeUzbekistan 11 ай бұрын
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 😅
@aksharpathak5226
@aksharpathak5226 11 ай бұрын
thanks bro for uploading the video.......I thought you stopped solving leetcode
@Itachi-mr8nj
@Itachi-mr8nj 11 ай бұрын
Bro is gonna pretend like he didn't go missing for a few days
@rahulchauhan.
@rahulchauhan. 11 ай бұрын
One can adapt this problem to find the maximum falling path too!
@ahmedtremo
@ahmedtremo 11 ай бұрын
Welcome back :D
@alviahmed7388
@alviahmed7388 11 ай бұрын
When will you stream next?
@XEQUTE
@XEQUTE 11 ай бұрын
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 11 ай бұрын
Sure, will do!
@Pegasus02Kr
@Pegasus02Kr 11 ай бұрын
Is it truly a solution for medium difficulty problem? was much harder to understand than most of hard problem for me..
@justintang6313
@justintang6313 11 ай бұрын
Is the DP solution top-down or bottom-up?
@imretakacs8952
@imretakacs8952 11 ай бұрын
At line 8, should not that be c >= 0 instead of c > 0.
@mikerico6175
@mikerico6175 11 ай бұрын
Could do += line 10 and use inf instead of float(“inf”)
@phatboislym
@phatboislym 11 ай бұрын
what is "line 10"?
@mikerico6175
@mikerico6175 11 ай бұрын
@@phatboislymmatrix[r][c] = matrix[r][c] + …. instead just do matrix[r][c] +=
@BirajDahal-z6u
@BirajDahal-z6u 11 ай бұрын
@@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])
@Dancedfsk8
@Dancedfsk8 11 ай бұрын
Finally!
@rohitsharma45-q2l
@rohitsharma45-q2l 11 ай бұрын
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 11 ай бұрын
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 11 ай бұрын
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
@setiyakitchen
@setiyakitchen 4 ай бұрын
yes
Sum of Subarray Minimums - Leetcode 907 - Python
18:51
NeetCodeIO
Рет қаралды 36 М.
SLIDE #shortssprintbrasil
0:31
Natan por Aí
Рет қаралды 49 МЛН
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
Freedom Trail - Leetcode 514 - Python
25:18
NeetCodeIO
Рет қаралды 14 М.
Out of Boundary Paths - Leetcode 576 - Python
18:20
NeetCodeIO
Рет қаралды 15 М.
Longest Ideal Subsequence - Leetcode 2370 - Python
28:02
NeetCodeIO
Рет қаралды 12 М.
Cherry Pickup II - Leetcode 1463 - Python
24:00
NeetCodeIO
Рет қаралды 17 М.
Target Sum - Leetcode 494 - Python
20:07
NeetCodeIO
Рет қаралды 8 М.
Score After Flipping Matrix - Leetcode 861 - Python
22:30
NeetCodeIO
Рет қаралды 10 М.
Largest Divisible Subset - Leetcode 368 - Python
22:57
NeetCodeIO
Рет қаралды 16 М.
Furthest Building You Can Reach - Leetcode 1642 - Python
11:08
NeetCodeIO
Рет қаралды 17 М.
SLIDE #shortssprintbrasil
0:31
Natan por Aí
Рет қаралды 49 МЛН