Longest ZigZag Path in a Binary Tree - LeetCode 1372 - Python Solution

Поділитися
Вставка
  • Опубліковано 11 жов 2024

КОМЕНТАРІ • 20

  • @codewithcarter
    @codewithcarter  Рік тому

    How is your LeetCode grind going? Comment below a Leetcode question you need help with!! 🤠

  • @nikakondra5321
    @nikakondra5321 10 місяців тому +1

    Thank you! It was easy to understand after watching your vid!

  • @souviksen5177
    @souviksen5177 6 місяців тому

    which tool youre using for drawing on screen ?

  • @mahletlulseged4858
    @mahletlulseged4858 4 місяці тому

    Great explanation ! thanks

  • @sriracha9729
    @sriracha9729 11 місяців тому

    simple and clean, thanks

  • @ashishshethia6549
    @ashishshethia6549 Рік тому +1

    very good solution

  • @HeihachiChaolan
    @HeihachiChaolan 5 місяців тому

    What if you need to go right three times? I don't understand how going right twice takes care of every situation where the new node needs to be the start of "depth" again.

    • @kushagarsharma4783
      @kushagarsharma4783 4 місяці тому

      You are recursively doing it you go right-> else part-> going left with incremented depth , going right with reset depth , same thing repeating for right again

  • @aaditya_87
    @aaditya_87 8 місяців тому

    you don’t even need to include current depth in the max function (line 10,17)

  • @rayenchtioui8188
    @rayenchtioui8188 Рік тому

    thank you for the explanation!

    • @codewithcarter
      @codewithcarter  Рік тому

      So happy you found it helpful!! Best of luck with your LeetCode grind! 🙏

  • @vladhilko
    @vladhilko Рік тому +1

    Thank you!

  • @BaoNguyen-d8u
    @BaoNguyen-d8u Місяць тому

    thank you kind sir

  • @sohammukherjee1392
    @sohammukherjee1392 Рік тому

    Nothing but THANKS

  • @daminirijhwani5792
    @daminirijhwani5792 8 місяців тому

    lets go vimmer!

  • @adityadeep619
    @adityadeep619 3 місяці тому

    Great explanation ! thanks