Validate Binary Tree Nodes - Leetcode 1361 - Python

preview_player
Показать описание


0:00 - Read the problem
0:30 - Drawing Explanation
5:33 - Coding Explanation

leetcode 1361

#neetcode #leetcode #python
Рекомендации по теме
Комментарии
Автор

Was waiting for this from 6 hours haha

amoghsv
Автор

Same can be done with stack to reduce memory

ngneerin
Автор

Can you do it with DSU? I am stuck at 42/44.
Failed Test Case:
n = 3
[1, -1, -1]
[-1, -1, 1]
I am checking for connected components == 1 plus no cycles. What am I missing??

akhilchauhan
visit shbcf.ru