ความคิดเห็น •

  • @takeUforward
    @takeUforward 2 ปีที่แล้ว +53

    Let's continue the habit of commenting “understood” if you got the entire video.
    Do follow me on Instagram: striver_79

  • @tejashwinibadi9984
    @tejashwinibadi9984 ปีที่แล้ว +104

    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😊

  • @anikethdeshpande8336
    @anikethdeshpande8336 ปีที่แล้ว +10

    your graphs series is amazing, after watching all previous videos, i could solve this problem on my own , thank you so much

  • @anirvangoswami
    @anirvangoswami ปีที่แล้ว +28

    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.

  • @aryanshaw4447
    @aryanshaw4447 ปีที่แล้ว +25

    Wonderful Explanation I wrote the BFS for it myself

  • @arkajyotinaskar2858
    @arkajyotinaskar2858 ปีที่แล้ว +5

    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💥

  • @RahulGuptaa29
    @RahulGuptaa29 ปีที่แล้ว +30

    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[ ][ ]

    • @atulnath1474
      @atulnath1474 7 หลายเดือนก่อน

      Or just use arrays.copyOf

    • @dharminnagar6226
      @dharminnagar6226 หลายเดือนก่อน

      Use Arrays.copyOf()

    • @saicharanchintha2327
      @saicharanchintha2327 หลายเดือนก่อน

      It will work with the original image itself, so it will work using the ans reference also.

  • @becSaurabhKumarSingh
    @becSaurabhKumarSingh ปีที่แล้ว +1

    striver you are just nailing it, was able to do it without seeing the solution.

  • @abdallaalhag4425
    @abdallaalhag4425 6 หลายเดือนก่อน

    I was able to solve the problem with BFS and DFS just after you explained the problem. The first 3 minutes were just enough!

  • @yevengyklaus7066
    @yevengyklaus7066 ปีที่แล้ว

    Thank you for explaining the direction array concept! I always wondered why it has that structure! Thank you!

  • @eklavya22k34
    @eklavya22k34 10 หลายเดือนก่อน

    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.

  • @ishwaripednekar5164
    @ishwaripednekar5164 ปีที่แล้ว +2

    Understood! Thank you so much for the great playlist🤩

  • @cinime
    @cinime 2 ปีที่แล้ว +1

    Understood! Great explanation as always, thank you very much!!

  • @raghavagrawal9240
    @raghavagrawal9240 ปีที่แล้ว

    Great series! Solved in a go before watching the explanation.

  • @preetkatiyar969
    @preetkatiyar969 ปีที่แล้ว +2

    U R SUCH AN AMAZING PERSON WITH EXCELLENT TEACHING SIR. GOD BLESS YOU.

  • @neelx9437
    @neelx9437 ปีที่แล้ว

    solved it without watching the code....because you explained number of islands so beautifully! thank u bhaiya

  • @rohitshrirame2378
    @rohitshrirame2378 ปีที่แล้ว +5

    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!

    • @sumerrawat6947
      @sumerrawat6947 ปีที่แล้ว +6

      If this playlist is so good , I wonder how good will be the extremely popular dp series

  • @user-ny1kv3xh4w
    @user-ny1kv3xh4w ปีที่แล้ว

    Best graph series EVER 💚 Thank you Striver

  • @manyagautamrajput9796
    @manyagautamrajput9796 ปีที่แล้ว +7

    Sometimes I just stop listening and start looking at u and admire how beautifully u are explaining this ...thankyou so much

    • @rishabhgupta1222
      @rishabhgupta1222 22 วันที่ผ่านมา +2

      pyaar to nhi ho gya 😅😅

  • @suheabkhan2546
    @suheabkhan2546 2 ปีที่แล้ว

    understood!!! thank you so much for the wonderful playlist

  • @devenvedi128
    @devenvedi128 ปีที่แล้ว

    Great explanation striver sir :) you're our saviour!!

  • @shaikrahaman8933
    @shaikrahaman8933 ปีที่แล้ว

    Awesome intuition I solved without watching the code thank you so much striver 🙏

  • @TravelTracksByDebo
    @TravelTracksByDebo ปีที่แล้ว

    understood wonderful explanation... striver bhaiya makes advanced dsa interesting and easy for students like us....gem of a explanation

  • @rupamrai9455
    @rupamrai9455 ปีที่แล้ว +1

    Absolutely amazing explanation🔥🔥🔥

  • @iDepth
    @iDepth 2 ปีที่แล้ว

    Understood... ! Thank you for this playlist

  • @VIVEKKUMAR-km7tw
    @VIVEKKUMAR-km7tw 6 หลายเดือนก่อน

    Your Logic Explanation is great.

  • @mriduljain6809
    @mriduljain6809 ปีที่แล้ว +5

    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

  • @photon7166
    @photon7166 ปีที่แล้ว +6

    sir watched your graph series from start and solved this on my own .Thanks❤❤

  • @komalkrishna7836
    @komalkrishna7836 ปีที่แล้ว

    understood! Wonderful explanation

  • @user-el6hv6em7m
    @user-el6hv6em7m 12 วันที่ผ่านมา

    understood... thanks for this amazing series :)

  • @Alokkkk18
    @Alokkkk18 2 ปีที่แล้ว

    Thanks you so much Bhaiya ❣️🙏for this epic graph series

  • @rishika6525
    @rishika6525 ปีที่แล้ว

    yeah absolutely. I missed "I hope you guys are doing extremely well" makes my day😀

  • @shashankpratapwar-wj7xl
    @shashankpratapwar-wj7xl 3 หลายเดือนก่อน

    aap jab samjhate ho to kuch bhi samajh jaata hai......god bless you

  • @enigmanarratives1
    @enigmanarratives1 ปีที่แล้ว

    its such a good feeling when u solve the Question yourself

  • @harshvardhansingh2272
    @harshvardhansingh2272 ปีที่แล้ว

    understood striver
    great explanation

  • @vikasbagri1225
    @vikasbagri1225 ปีที่แล้ว

    understood it very well...

  • @ramanpareek5218
    @ramanpareek5218 19 วันที่ผ่านมา

    Liked the video, notes taken, understood

  • @sripriyapotnuru5839
    @sripriyapotnuru5839 ปีที่แล้ว

    Thank you, Striver 🙂

  • @subhamoybera6456
    @subhamoybera6456 ปีที่แล้ว

    Great explanation 👍

  • @shyren_more
    @shyren_more ปีที่แล้ว

    understood, thanks!

  • @VedPrakashLearnToGrow
    @VedPrakashLearnToGrow ปีที่แล้ว

    Thanks for amazing explanation

  • @tawkeer4
    @tawkeer4 4 หลายเดือนก่อน

    The command you have over graph problems is 🔥🔥

  • @sachin_singh_tomar_
    @sachin_singh_tomar_ หลายเดือนก่อน

    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.

  • @kirtitung4877
    @kirtitung4877 2 ปีที่แล้ว

    Thank you so much bro!!!!

  • @sagartaak4017
    @sagartaak4017 ปีที่แล้ว

    Best explanation 💥

  • @stith_pragya
    @stith_pragya 8 หลายเดือนก่อน +1

    Thank You So for this wonderful video.........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @_jasneetsingh_
    @_jasneetsingh_ ปีที่แล้ว

    thank you so much. God Bless Us

  • @suheabkhan2546
    @suheabkhan2546 2 ปีที่แล้ว

    understood very good

  • @mananarora141
    @mananarora141 ปีที่แล้ว +1

    UNDERSTOOD!!!

  • @pranavmaniyar9901
    @pranavmaniyar9901 ปีที่แล้ว

    understood , op explaination

  • @user-kl3qv1sc8k
    @user-kl3qv1sc8k 2 หลายเดือนก่อน

    Understood Striver, thanks a lot

  • @bhavkushwaha
    @bhavkushwaha 20 วันที่ผ่านมา

    Understood Striver, Thankyou!

  • @manavnaharwal1921
    @manavnaharwal1921 2 ปีที่แล้ว

    Understood 🙌

  • @shubhigupta5689
    @shubhigupta5689 ปีที่แล้ว

    Understood🌻

  • @himangshubiswas542
    @himangshubiswas542 ปีที่แล้ว

    I love ur opening line

  • @user-kk5vn5nf5v
    @user-kk5vn5nf5v 6 หลายเดือนก่อน

    best explanation☺

  • @arnabroy2995
    @arnabroy2995 ปีที่แล้ว

    understood well

  • @shivisingh9975
    @shivisingh9975 หลายเดือนก่อน

    Understood sir !

  • @LBK3
    @LBK3 ปีที่แล้ว

    Understood ❤

  • @Codekage1
    @Codekage1 ปีที่แล้ว +1

    Understood!

  • @huungryyyy
    @huungryyyy 18 วันที่ผ่านมา

    understood striver

  • @__ngl__
    @__ngl__ หลายเดือนก่อน +2

    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!

  • @Aryan-gn9ux
    @Aryan-gn9ux 9 หลายเดือนก่อน

    Understood!

  • @_hulk748
    @_hulk748 ปีที่แล้ว

    Understood sir🙇‍♂❤🙏

  • @vipulmaheshwari2321
    @vipulmaheshwari2321 ปีที่แล้ว +1

    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.

  • @KratosProton
    @KratosProton ปีที่แล้ว

    Understood sirji

  • @lakshsinghania
    @lakshsinghania ปีที่แล้ว

    was able to do the bfs on my own
    :)

  • @hashcodez757
    @hashcodez757 10 หลายเดือนก่อน

    understood !!

  • @adityasaxena6971
    @adityasaxena6971 ปีที่แล้ว

    Understood💯💯

  • @p38_amankuldeep75
    @p38_amankuldeep75 ปีที่แล้ว

    understood💙💙💙

  • @UECAshutoshKumar
    @UECAshutoshKumar 11 หลายเดือนก่อน +1

    Thank you sir

  • @prajwalhorti3717
    @prajwalhorti3717 ปีที่แล้ว

    understood!

  • @user-tk2vg5jt3l
    @user-tk2vg5jt3l 3 หลายเดือนก่อน

    Thank you bhaiya

  • @morganyu3391
    @morganyu3391 ปีที่แล้ว

    Understood bhaiya

  • @dreamyme543
    @dreamyme543 ปีที่แล้ว

    Understood:)

  • @akshanshsharma6025
    @akshanshsharma6025 ปีที่แล้ว +1

    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

    • @taneyasoni
      @taneyasoni ปีที่แล้ว

      can you share the bfs code? i wrote bs code and it gave me TLE

    • @shrujaigupta2586
      @shrujaigupta2586 11 หลายเดือนก่อน +1

      try to check if you addded the condition of checking whether the node is visited or not@@taneyasoni

    • @taneyasoni
      @taneyasoni 10 หลายเดือนก่อน +1

      thank you@@shrujaigupta2586

  • @codeman3828
    @codeman3828 2 หลายเดือนก่อน

    Thanks. Understood

    • @Ayush37262
      @Ayush37262 2 หลายเดือนก่อน

      Bro Time Complexity wala part thoda explain kar skte ho?? Smjh nhi aaya mujhe

  • @sbrosgamerz3470
    @sbrosgamerz3470 ปีที่แล้ว +1

    One man teaching entire India the best for free 🙂🙂🙂

  • @md.sajidhossain3146
    @md.sajidhossain3146 ปีที่แล้ว

    Take love from Bangladesh

  • @sukritinarang5016
    @sukritinarang5016 ปีที่แล้ว

    understood :)

  • @satendra6200
    @satendra6200 9 หลายเดือนก่อน

    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

  • @csea_37_shayoribhowmick53
    @csea_37_shayoribhowmick53 ปีที่แล้ว

    Thank you so much

  • @ganeshmula4508
    @ganeshmula4508 ปีที่แล้ว

    understood sir

  • @adarshkumarrao3478
    @adarshkumarrao3478 ปีที่แล้ว +1

    understood

  • @SumitKeshariMCS
    @SumitKeshariMCS ปีที่แล้ว +6

    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

  • @chitranshjain5075
    @chitranshjain5075 2 ปีที่แล้ว

    Understood.

  • @raushankumar6993
    @raushankumar6993 9 หลายเดือนก่อน

    thanks

  • @mriduljain1981
    @mriduljain1981 ปีที่แล้ว

    understood.

  • @debadritadutta2308
    @debadritadutta2308 ปีที่แล้ว

    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?

  • @monikadhiman1404
    @monikadhiman1404 ปีที่แล้ว

    "Understood":)🤩

  • @harshdasila6680
    @harshdasila6680 2 ปีที่แล้ว

    understooodddddd

  • @AbhishekPandey-yl3bp
    @AbhishekPandey-yl3bp ปีที่แล้ว

    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

  • @tasneemayham974
    @tasneemayham974 6 หลายเดือนก่อน

    BESTTT BESST TEACHHERRR

  • @shyren_more
    @shyren_more ปีที่แล้ว

    defining the dfs/bfs function as private is just a good code practice or does it have some other reason?

  • @nextnotification9857
    @nextnotification9857 4 หลายเดือนก่อน

    solved on my own before watching the video using dfs🙂

  • @sdexstarlord
    @sdexstarlord ปีที่แล้ว +1

    Can anyone please tell me why we used queue in prev problem but not in this problem !!!

  • @surajpalsau870
    @surajpalsau870 ปีที่แล้ว +1

    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

  • @ayushgaurabh8604
    @ayushgaurabh8604 2 หลายเดือนก่อน

    awesome

  • @practice8844
    @practice8844 ปีที่แล้ว

    Striver bhaiya OP

  • @aryashjain7893
    @aryashjain7893 2 ปีที่แล้ว

    Understood thanku striver, i used the delta i & j approach ( from last video) and just used the condition abs( i-j) != (2 and 0)