Maximum Difference Between Node and Ancestor | Leet code 1026 | Theory explained + Python code

preview_player
Показать описание
This video is a solution to Leet code 1026, Maximum Difference Between Node and Ancestor. I explain the question, go over how the logic / theory behind solving the question and finally solve it using Python code.

Comment below if you have a better solution to this problem!

Let me know if you have any feedback and don't forget to subscribe for more videos!

Code:

Time stamps:
0:00 Question
3:26 Solution Explained
10:01 Python Code

More leetcode questions solved:

Gear used:
Рекомендации по теме
Комментарии
Автор

This is about the 4th time I've needed to watch a tutorial on a LC problem before I solved it, and I was genuinely fucked on this one.

RocketPropelledWombat
Автор

hey really helpful stuff! might I add a suggestion? maybe adding the time and space complexity of your solutions can be really helpful to some

TheBadkid
Автор

Hey, How does the max and min value get updated to 8, 8 before going to the right sub tree?
When we use the return function(when we reach the leaf node) do all the values get updated to there previous max and min values?
I have a hard time understanding these concepts could you please clarify them.

gaddesaishailesh
visit shbcf.ru