After watching the above videos in this playlist, I solved this on my own🥺.
You make every difficult topic an easy one. Thank you so much😊
your graphs series is amazing, after watching all previous videos, i could solve this problem on my own , thank you so much
Can't even imagine that the topic that used to send shivers down my spine is now being solved by me, even just after watching the explanation of the problem. Thanks a lot, mate. You are a genius.
Wonderful Explanation I wrote the BFS for it myself
I just understood the problem from your explanation, found it kind of similar to the no. of islands question, coded it, and bang on I wrote both bfs and dfs code correctly! This series is lit💥
For Java people:
int[ ][ ] ans = image; // this won't create the copy of the image array, just that ans is pointing to same as image so we are indirectly changing the original array
to make a copy run nested for loops and copy them individually and store it in ans[ ][ ]
It will work with the original image itself, so it will work using the ans reference also.
striver you are just nailing it, was able to do it without seeing the solution.
I was able to solve the problem with BFS and DFS just after you explained the problem. The first 3 minutes were just enough!
Thank you for explaining the direction array concept! I always wondered why it has that structure! Thank you!
Explained it like it is a piece of cake. Beauty is how a mammoth topic like Graph look so tiny when u enlighten us.
True Beauty is in Simplicity. Love ur videos. Thank u for sharing ur knowledge and making this a better world.
Tc. Stay safe. Keep growing.
Understood! Thank you so much for the great playlist🤩
Understood! Great explanation as always, thank you very much!!
Great series! Solved in a go before watching the explanation.
U R SUCH AN AMAZING PERSON WITH EXCELLENT TEACHING SIR. GOD BLESS YOU.
solved it without watching the code....because you explained number of islands so beautifully! thank u bhaiya
understood!!! har ek video me kuch na kuch naya sikhne ko mil raha h.... not only just soln but writing the code h in efficient way... will surely watch ur dp series after this!!!! waiting for the next lectures of the series
take care!
If this playlist is so good , I wonder how good will be the extremely popular dp series
Best graph series EVER 💚 Thank you Striver
Sometimes I just stop listening and start looking at u and admire how beautifully u are explaining this ...thankyou so much
understood!!! thank you so much for the wonderful playlist
Great explanation striver sir :) you're our saviour!!
Awesome intuition I solved without watching the code thank you so much striver 🙏
understood wonderful explanation... striver bhaiya makes advanced dsa interesting and easy for students like us....gem of a explanation
Absolutely amazing explanation🔥🔥🔥
Understood... ! Thank you for this playlist
Your Logic Explanation is great.
Understood Bhaiya!!
Bfs approach:
void bfs(int r,int c,vector& grid,vector &vis,int color,int prev)
{
int drow[4]={0,1,0,-1};
int dcol[4]={1,0,-1,0};
queue q;
q.push({r,c});
vis[r][c]=color;
while(!q.empty())
{
int p=q.front().first;
int s=q.front().second;
q.pop();
for(int i=0;i=0 && nr=0 && nc
sir watched your graph series from start and solved this on my own .Thanks❤❤
understood! Wonderful explanation
understood... thanks for this amazing series :)
Thanks you so much Bhaiya ❣️🙏for this epic graph series
yeah absolutely. I missed "I hope you guys are doing extremely well" makes my day😀
aap jab samjhate ho to kuch bhi samajh jaata hai......god bless you
its such a good feeling when u solve the Question yourself
understood striver
great explanation
understood it very well...
Liked the video, notes taken, understood
Thank you, Striver 🙂
Great explanation 👍
understood, thanks!
Thanks for amazing explanation
The command you have over graph problems is 🔥🔥
for num enclaves problem at leet code you can do one thing that is traversing only boundries of grid i.e top row bottom row left column and right column and if not visited ho or land ho then call bfs function like we do in this video after doing this run a for loop and Count the remaining land cells that are not visited. Thanks striver you make it very easy.
Thank you so much bro!!!!
Best explanation 💥
Thank You So for this wonderful video.........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
thank you so much. God Bless Us
understood very good
UNDERSTOOD!!!
understood , op explaination
Understood Striver, thanks a lot
Understood Striver, Thankyou!
Understood 🙌
Understood🌻
I love ur opening line
best explanation☺
understood well
Understood sir !
Understood ❤
Understood!
understood striver
Can someone explain why the TC is O(MN) + O(4MN) and not just O(4MN)? I know ultimately it's the same thing but I really want to understand the concept. Thanks Striver!
Understood!
Understood sir🙇♂❤🙏
Isn't the recursion space stack will be O(max(m,n))?? Because as we need to cover up all the elements ranging in n*m pixel table the maximum we can go is the maximum of given rows and given columns.
Understood sirji
was able to do the bfs on my own
:)
understood !!
Understood💯💯
understood💙💙💙
Thank you sir
understood!
Thank you bhaiya
Understood bhaiya
Understood:)
after watching the rotten oranges i solved this question by myself using bfs and its time to learn using dfs thank you so much for the clear explanation
try to check if you addded the condition of checking whether the node is visited or not@@taneyasoni
Thanks. Understood
Bro Time Complexity wala part thoda explain kar skte ho?? Smjh nhi aaya mujhe
One man teaching entire India the best for free 🙂🙂🙂
Take love from Bangladesh
understood :)
solved it by myself just watching the privious island video....two or three problem on leetcode can be solve by using the logic of island
understood sir
understood
Here is both dfs and bfs approach:
class Solution {
private:
void dfs(vector&image,vector&img,int sr,int sc,int iniColor,int newColor)
{
img[sr][sc] = newColor;
int delrow[] = {-1,0,1,0};
int delcol[] = {0,1,0,-1};
for(int i=0;i
Understood.
thanks
understood.
why does it show compilation error if instead of copying the image matrix to a new matrix,I modify the image matrix itself and return it?
"Understood":)🤩
understooodddddd
Is it copying image array into ans array or is it just passing the reference to it and it will end up changing the image array anyway? Talking about java code
BESTTT BESST TEACHHERRR
defining the dfs/bfs function as private is just a good code practice or does it have some other reason?
solved on my own before watching the video using dfs🙂
Can anyone please tell me why we used queue in prev problem but not in this problem !!!
I always solve the question just after watching 5 minutes of every video, & this works well.
Try to solve questions like me & thanks me later
awesome
Striver bhaiya OP
Understood thanku striver, i used the delta i & j approach ( from last video) and just used the condition abs( i-j) != (2 and 0)
Let's continue the habit of commenting “understood” if you got the entire video.
Do follow me on Instagram: striver_79