2096. Step-By-Step Directions From a Binary Tree Node to Another | LCA | Backtracking | 2 Pointers

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

Комментарии • 14

  • @Ayush37262
    @Ayush37262 2 месяца назад +4

    You are quite better than codestorywithMIK

  • @AyushSharma-tj1kp
    @AyushSharma-tj1kp 2 месяца назад +5

    This is giving memory exceed limit error how to fix that??

    • @jimspatel2407
      @jimspatel2407 2 месяца назад +1

      You need to pass the string by reference. may be you are trying to passing string without reference.

    • @rishabhranjan5162
      @rishabhranjan5162 2 месяца назад +1

      passing string without reference leads to making a copy of the string for every recursive call, thus leading to memory exceed limit

    • @AyushSharma-tj1kp
      @AyushSharma-tj1kp 2 месяца назад

      @@rishabhranjan5162 ok thanks got it

  • @prathamgolwala9282
    @prathamgolwala9282 2 месяца назад +3

    Bhaiya Dp on trees ka crash course pls 🙏

  • @curlyoreki
    @curlyoreki 2 месяца назад

    also link the refrence problem you are using in the problem

  • @ArhamSheikh-kl1bo
    @ArhamSheikh-kl1bo 2 месяца назад +3

    Explanation is always at next level 🔥

  • @abhishekshukla5484
    @abhishekshukla5484 2 месяца назад

    If u upload explaination notes it will be fine

  • @akshaanshsrivastava9817
    @akshaanshsrivastava9817 2 месяца назад +1

    Very Heavy Explanation..

  • @tgayush1424
    @tgayush1424 2 месяца назад

    No need to take j can be done with i alone -
    int i = 0, n1 = rootToStartPath.size(), n2 = rootToDestPath.size();
    int lcaLenFromRoot = 0;
    while(i

  • @tgayush1424
    @tgayush1424 2 месяца назад

    i have one question ,is it good to use global variables ?
    Using global variables is not a good way to write solution for a problem i guess.

  • @harshlimbachiya7510
    @harshlimbachiya7510 2 месяца назад

    Great Thumbnails ++

  • @badasspandit1886
    @badasspandit1886 2 месяца назад

    house robber 3 kraa do
    Mnnit se hi hoon