LeetCode 968. Binary Tree Cameras Explanation and Solution

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


Thanks in advance. :D

Happy coding every day!
Рекомендации по теме
Комментарии
Автор

Simples solution. Thanks for the explanation!

akhil_dh_
Автор

I have been waiting for these ..welcome back👍 thanks

tathagatnegi
Автор

You are back :D, anyway happy holidays!

warzone
Автор

Welcome back!! Looking forward to watch
more amazing content from you.

hannahkiesel
Автор

& could you suggest some problems to practice?

learner_
Автор

Ma'am, could you please explain 39 line of your code? why 2 is returned, & what about the case when either of 2 children return 1 or both?

learner_
Автор

Thanks! Nice explanation -- almost similar to your distribute coins solution. It would have been nice if you had used enums to make the code more readable.
Can you also do 'even valued grandparents' (LC 315) and 'count pair of nodes within distance' LC 1530? I think they all use similar post-order logic.
Maybe you can do a series of 'post-order' logic where we store final ans to a global var (data member), and other series where we store more data than final ans to another struct/class (e.g. zigzag len LC 1372, K-balanced nodes, etc. -- something similar you did for 'rotated sorted array' where you solved 4 related problems in one video.
I say this bcoz in one of your earlier videos, you had asked for suggestions on what you should do next. :-) Thanks! Looking forward to more videos.

anant
welcome to shbcf.ru