The univalue problem explanation seems worng because the left most leaf tree is shown as 1, but later in the explanation it changes to 2 and then it starts making sense.
Great video! Btw, in the diameter problem, is it possible to do it without using the (inner/method /global) function ? like just returning max(self.diameterOfBinaryTree(..) + self.diameterOfBinaryTree(..) ) + 1 or similar?? I want to know how to kind of know if it's not possible. I always used modification of non local approach years back with these dfs questions but seeing so many cleaner solutions which just don't use those extra functions is often now due to which I m often stuck.
Tried it in leetcode. 1. Unoptimized took 7ms 2. Solution 1 optimized with map memoization took 90ms 3. Post-order traversal took 0ms Their test cases do not validate the memoization theory. But thats on the limits of the cases I am guessing. They are limit upto a 1000 nodes only.
More videos like this please!
this is fire jimmy! thank you for putting this together 🙏🙏
I understand why the is called hello interview because I am excited show what I learned
Haha, love it!
Letsgooo! Finally! :D
Nice video! I would love it if you can do a design Netflix video as well, recently I got asked that.
Can you put these coding interview questions in a playlist as well?It will be easy to follow
Good idea, doing that now.
@@hello_interview perfect
The univalue problem explanation seems worng because the left most leaf tree is shown as 1, but later in the explanation it changes to 2 and then it starts making sense.
Great video!
Btw, in the diameter problem, is it possible to do it without using the (inner/method /global) function ? like just returning max(self.diameterOfBinaryTree(..) + self.diameterOfBinaryTree(..) ) + 1 or similar?? I want to know how to kind of know if it's not possible. I always used modification of non local approach years back with these dfs questions but seeing so many cleaner solutions which just don't use those extra functions is often now due to which I m often stuck.
Yes it is possible.
Query: Can we not use memoization in brute force approach of diameter question and get same big-o as the optimized solution?
You can! It’s equivalent to memoization in dynamic programming
Tried it in leetcode.
1. Unoptimized took 7ms
2. Solution 1 optimized with map memoization took 90ms
3. Post-order traversal took 0ms
Their test cases do not validate the memoization theory. But thats on the limits of the cases I am guessing. They are limit upto a 1000 nodes only.
Very nice! I'd love to see a video of Dijkstra's. A friend was asked to solve a problem with Dijkstra's at Google recently