Master Data Structures & Algorithms For FREE at AlgoMap.io!
@kapilrules4 ай бұрын
@GregHogg you are awesome
@nicolofretti86013 ай бұрын
Thank you, Greg! I love your teaching approach. You start by explaining problems from a high-level perspective, helping us understand the logic behind the solution. 🧠 Then, you dive deep into the source code. 💻 Your work is truly appreciated :)
@GregHogg3 ай бұрын
Thank you for such a kind comment 🙏🏼
@laharianegama5004Ай бұрын
Greg, thank you for making such content. This is a game changer for me.
@anshpradhan19544 ай бұрын
Greg, I must say, Im in love with python cuz of you, thank you, python being on of those languages, which is easy to learn BUT hard to master, you did a pretty good job at convincing me to use it for solving leetcode problems, leetcode seems easier with python idk why 😂😂😂
@GregHogg4 ай бұрын
Leetcode is definitely easiest in Python lol
@KaushikkrSarma5 ай бұрын
Your explanation is really good , your website is awesome as well . I could finally do a graph problem on my own , all thanks to you greg , keep going 👍
@GregHogg5 ай бұрын
That's amazing! Very glad to hear it
@leonardodanelutti44902 ай бұрын
Can you just iter on every element of the matrix and do this operation when enconutering a 1: m[i][j] = m[i-1][j] + m[i][j-1] - m[i-1][j-1] + 1 And then return the max value obtained
@leonardodanelutti44902 ай бұрын
This should have a time complexity of theta(m*n), space complexity of theta(Min{m,n}) and be much faster in practice
@amazingmanish7 ай бұрын
I thought of the same solution but forgot that it's actually DFS. Nice explanation. Good work buddy.
@GregHogg7 ай бұрын
Oh awesome! Thanks a bunch!
@anirudd017 ай бұрын
This was amazing, you made it look easy , but yea it is easy now thanks to you, keep up the good work
@GregHogg7 ай бұрын
Super super glad to hear it. Thanks a ton 😊
@PhonesUnboxing6 ай бұрын
Can use BFS as well
@SimpChimp-zl3ns2 ай бұрын
3:24 that siren got me looking thru the my window 😅😂
@GarouNguyen5 ай бұрын
Bro you nail djt I understand, thank you bro
@marknuggets7 ай бұрын
Lol amazing quality
@GregHogg7 ай бұрын
Thank you so much!
@antonmykhailovskyi4477 ай бұрын
However, you are doing backtracking here and not dfs, aren`t you? Or am I missing something?
@GregHogg7 ай бұрын
There's an absurdly tiny difference between backtracking and DFS. Technically this is dfs because when we make a land (1) a water (0), we never undo (backtrack) this modification.
@antonmykhailovskyi4477 ай бұрын
@@GregHogg got it, thank you! I'm kind of new in this sphere, so I was a bit confused