Surrounded Regions | Boundary DFS ✅ Graph Explained Hindi Leetcode | Complete Graph Videos

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

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

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

    i always try the problem for 1-1.5hrs before watching your solutions
    .................... i respect that you always keep reminding people to try the problem on their own.......Thanks a lot bhaiya for such awsome videos...

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

    Bhaiya i respect that you always keep reminding people to try the problem on their own, and i always try the problem for 1-1.5hrs before watching your solutions

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

      Thanks a ton for this positive words
      Please, share this channel in your college, groups, or LinkedIn bcoz it's cost nothing to you 😀

  • @RohitKumar-cv7qb
    @RohitKumar-cv7qb ปีที่แล้ว +4

    Thanks, done without seeing the solution code, Explanation was enough, 🌹

  • @deep1998-j1v
    @deep1998-j1v ปีที่แล้ว +1

    Wah kya code likha hai, ❤ Modular, clean, just gr8, perfectly understood.

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

    very easy explanation (1 bar me samajh me aa gya👌👌)

  • @Ybash2979
    @Ybash2979 7 หลายเดือนก่อน +1

    pyaara smjhaya thanku bhai

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

    Waaah bhaiyaaa ULTIMATE, mazaaa aa gyaaa...

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

    can you explain the time and space complexity of each solution after giving the solution

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

    Very nicely explained, Thanks a lot!

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

    u are so self-less, always thinking of the benefit of students

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

      Thanks Adarsh
      Please, share this channel in your college, groups, or LinkedIn bcoz it's cost nothing to you 😀

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

    Bahut hi OP approach , mazza agaya

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

    Best Explanation For Boundary Traversal... Thanks

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

    Easy solution!Btw thanks for concept!

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

    I tried different approach but this approach is EXCELLENT 😂🎉

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

    I always follow your tips.😇😇

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

    time complexity jyaada hai bro but iski like boundary aur fir andar ka . btw nice explanation .

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

    superb explanation brother thank you

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

    Good one, boundary DFS, catchy name as well to remember.

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

    Amazing explanation sir.

  • @VikashSingh-sf2xp
    @VikashSingh-sf2xp 5 หลายเดือนก่อน

    Good explanation

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

    very great explanation....

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

    clear crisp

  • @divya-ei8du
    @divya-ei8du 2 ปีที่แล้ว

    Great vid!😀

  • @Rohitraj-70
    @Rohitraj-70 12 วันที่ผ่านมา

    thanks

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

    If there ie a O at boundary-1 ..how are we dealing with that ...

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

    Bhai I m confuse I have abdul bari dsa videos and coding ninja c++ dsa videos and sometimes watch love babbar videos as well as ur videos also but not ale to choose where i have to learn

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

      😅😅
      You have lots of resources buddy
      Aap aise socho ki ...at the end aapse questions hone chahiye
      Wo kaha se padhkar ho raha hai ....
      Ye dekho aap

  • @Sp_Global-oc4tf
    @Sp_Global-oc4tf 7 หลายเดือนก่อน

    shaktiman hi gangadhar hai!!! graoh br like.

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

    best trick.....

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

    I attempted this on my own but i think there is slight error in my code ,
    This is the code i wrote
    bool isValid(int i, int j, int n, int m, vector& board){
    if (i>=0 and i=0 and j

    • @VishalKumar-ce9pe
      @VishalKumar-ce9pe 2 ปีที่แล้ว

      class Solution {
      public:
      bool isValid(int i, int j, vector& board)
      {
      int m = board.size();
      int n = board[0].size();

      if(i>=0 && i=0 && j

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

    class Solution {
    public void solve(char[][] board) {
    boolean[][]vis=new boolean[board.length][board[0].length];
    for(int i=0;i

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

    bhaiya bfs wala
    class Solution {
    public:
    void solve(vector& board) {
    int n = board.size();
    int m = board[0].size();
    vector image(n, vector(m, 0));
    queue q;

    for (int i = 0; i < m; i++) {
    if (board[0][i] == 'O') {
    q.push({0, i});
    image[0][i] = 1;
    }
    }

    for (int i = 0; i < n; i++) {
    if (board[i][0] == 'O') {
    q.push({i, 0});
    image[i][0] = 1;
    }
    }

    for (int i = 0; i < m; i++) {
    if (board[n-1][i] == 'O') {
    q.push({n-1, i});
    image[n-1][i] = 1;
    }
    }

    for (int i = 0; i < n; i++) {
    if (board[i][m-1] == 'O') {
    q.push({i, m-1});
    image[i][m-1] = 1;
    }
    }

    int delrow[] = {-1, 0, 1, 0};
    int delcol[] = {0, -1, 0, 1};

    while (!q.empty()) {
    int row = q.front().first;
    int col = q.front().second;
    q.pop();

    for (int i = 0; i < 4; i++) {
    int nrow = row + delrow[i];
    int ncol = col + delcol[i];

    if (nrow >= 0 && ncol >= 0 && nrow < n && ncol < m && image[nrow][ncol] != 1 && board[nrow][ncol] == 'O') {
    q.push({nrow, ncol});
    image[nrow][ncol] = 1;
    }
    }
    }

    for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
    if (board[i][j] == 'O' && image[i][j] != 1) {
    board[i][j] = 'X';
    }
    }
    }
    }

    };

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

    My solution :->
    class Solution {
    public:
    void dfs(int i,int j,int n,int m,vector& board,vector&vis){
    if(i=m || vis[i][j]==1 || board[i][j]=='X'){
    return;
    }
    vis[i][j]=1;
    dfs(i+1,j,n,m,board,vis);
    dfs(i,j+1,n,m,board,vis);
    dfs(i-1,j,n,m,board,vis);
    dfs(i,j-1,n,m,board,vis);
    }
    void solve(vector& board) {
    //convert all those zeroes to x which are not a part of boundary region
    int n=board.size(),m=board[0].size();
    vectorvis(n+1,vector(m+1,0));
    for(int i=0;i

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

    Able to solelve it
    But in 10 attempts.😂

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

    22/32 done (19.8.22)

  • @VishalKumar-ce9pe
    @VishalKumar-ce9pe 2 ปีที่แล้ว +1

    ----------------------------------------------------------------CODE-----------------------------------------------------------------------------
    class Solution {
    public:
    bool isValid(int i, int j, vector& board)
    {
    int m = board.size();
    int n = board[0].size();

    if(i>=0 && i=0 && j

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

      ye th0 bawasir hai......c0de |ikha hai ya textb00k ka chapter

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

      this code is giving runtime error

    • @VishalKumar-ce9pe
      @VishalKumar-ce9pe ปีที่แล้ว

      @@rachnamalik7605 try to submit on Leetcode, yes it can be optimize....