Maximum Matrix Sum - Leetcode 1975 - Python

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


0:00 - Read the problem
0:30 - Drawing Explanation
12:03 - Coding Explanation

leetcode 1975

#neetcode #leetcode #python
Рекомендации по теме
Комментарии
Автор

managed to solve this one on my own, feeling so proud man..

ggggggg
Автор

There's a fine line between abandoning an idea saying "nah it's a shit idea" and asking "why it isn't working?" that comes from experience and experience comes from practicing . I adore your thought process

kingheisenberg
Автор

I am so happy and can't believe that I managed to solve it by myself and going through a process very similar to yours. The thinking, the trying, making logical interpretations and getting to the right approach.
Seems like I improved. Wouldn't have been possible without you Neetcode. Thank you so much ! 🙌

P.S : I miss the old thumbnails, remind me of good old Neetcode times.

business_central
Автор

Never had I thought that the solution would be this simple when I first read the question and spent the next 15 min staring at it.
Great solution Navdeep!

rahulr
Автор

thank god I gave up after 10mins and didn't waste hours on some crazy weird DP solution. Honestly don't think I'd ever arrive at this intuition.

edmonddantes
Автор

Fun fact. If there is a 0 somewhere you can just move the single negative number in the end and have it eaten by the zero. Also fun fact is that you dont have to bother with finding a 0 cuz, when you do the calculation u will subtract 2*0 anyway

sanis
Автор

Man, this was mind-blowing, the way you explain your thought process is ❤❤❤❤❤

paraspatil
Автор

Wow, this thought process is absolutely mind-blowing!

downtownsocialite
Автор

The solution just popped into my head as soon as I understood the problem.
It's fun but a little anoying when you think so fast you can't expain your thought process but I know my mind went into the direction of mathologers video on tiling with dominos.

anonanon
Автор

Woah. I've been intimidated by these because I thought I needed to be able to magically come up with the answer without thinking. I paused a bunch and made my own observations way before he revealed them and now i feel so much more confident :) it's also fun when something turns into a visualization and then your brain just does the rest on its own

adamoreilly
Автор

Thank you so much for expanding your initial thought process and not just the correct solution and why it ended up not working took similar approach and seeing you had similar thoughts was encouraging

jadenruan
Автор

My first idea is lets take a function with two parameter ( matrix, direction )
will calculate and return sum for real, then with all direction, then sum = max ( sum, helperfunction())
it will take O(4 *N) again for optimise we can use memorisation for storign that we ever did calculation of that two element or not.

pritamkumarpattanayak
Автор

thank you for your explanation, it helps me a lot!

Автор

This explanation is too good, thanks man!

shuvenduoffline
Автор

i first thought of a BFS approach from that i realised it is a logic question

dhruvsingal
Автор

Such an obvious one, can't believe I missed it. Was a good question though

amolvijayachandran
Автор

Actually true the problem was not difficult it was fun :)

Sourav
Автор

Damn this was one hell of an observation

debrupnandy
Автор

is this question solvable if we have to find the maximum sum if we can only do k operations instead of infinite operations?

paramgoswami
Автор

please solve leetcode 493.Reverse Pairs

bhanunani