These videos definitely are helpful, when I was working on my undergrad, they didn't really do that great of a job with algorithms, so I am trying to understand them a lot better now.
Josepch Will thanks! If you need help understand and learning these questions be sure to sign up for the interviewing service I created thedailybyte.dev/?ref=kevin I recommend joining the annual plan if you can!
Man You are great i was struggling to approach an exact solution, but just listening to your explanation of the problem only i was able to code it myself and submitted it. Great work .
Hey I was wondering for tree problems how I know if I need a helper function for my recursive calls and how I know what I should pass in as parameters. Sometimes we can just use the given function to solve the problem and sometimes we need a helper. Is there a guideline that can help with this?
Great question! It really depends on parameters you need to pass to the function and what the function needs to remember...for example if it needs to remember or add something to a previous result, you might have to make a helper function that takes an array of number (because the array will be the same for all of the recursive calls since it's passed by reference, not value). LMK if that makes sense, if it doesn't I'm happy to explain further :)
Jan Michael Austria thanks and anytime! If you need help with these kinds of questions and like my explanations check out the interviewing service I created thedailybyte.dev/?ref=kevin I’d recommend joining the annual plan if you can!
My interviews repo on GitHub in case you guys don't know about it! github.com/kdn251/interviews
These videos definitely are helpful, when I was working on my undergrad, they didn't really do that great of a job with algorithms, so I am trying to understand them a lot better now.
Josepch Will thanks! If you need help understand and learning these questions be sure to sign up for the interviewing service I created thedailybyte.dev/?ref=kevin I recommend joining the annual plan if you can!
Man You are great i was struggling to approach an exact solution, but just listening to your explanation of the problem only i was able to code it myself and submitted it. Great work .
This was really helpful! Thank you so much!
Great! Keep these up! Found your channel through your interviews github repo.
Thanks Justin I hope you're finding this channel and the repo helpful!
Hey I was wondering for tree problems how I know if I need a helper function for my recursive calls and how I know what I should pass in as parameters. Sometimes we can just use the given function to solve the problem and sometimes we need a helper. Is there a guideline that can help with this?
Great question! It really depends on parameters you need to pass to the function and what the function needs to remember...for example if it needs to remember or add something to a previous result, you might have to make a helper function that takes an array of number (because the array will be the same for all of the recursive calls since it's passed by reference, not value). LMK if that makes sense, if it doesn't I'm happy to explain further :)
@@KevinNaughtonJr Perfect Explanation !!
nice vid! thanks for the explanation Kevin. super solid!
Jan Michael Austria thanks and anytime! If you need help with these kinds of questions and like my explanations check out the interviewing service I created thedailybyte.dev/?ref=kevin I’d recommend joining the annual plan if you can!
Another solution could be:
class Solution {
int sum = 0;
public int sumOfLeftLeaves(TreeNode root) {
traverse(root, false);
return sum;
}
private void traverse(TreeNode node, boolean isLeft) {
if (node == null)
return;
traverse(node.left, true);
if (isLeft && node.left == null && node.right == null)
sum += node.val;
traverse(node.right, false);
}
}
I approached this problem using the same way you mentioned... Kinda looks more cleaner
Cool ,please take harder tree problems.Also please if we have very strong command on data structures then its sufficient for companies?
Awesome work, would you help me personally I have few doubts
I'm happy to help you however I can!
Kindly make a playlist on Microsoft
Great content! Subbed! :D
What would be the time complexity of this solution?
Thanks David and happy to hear it! The time complexity is O(n) where n is the number of nodes in the tree!
Such concise logic for a dp. #review
Bro u always solve questions labelled easy in this video seriesWhy don't have a mix of some good medium questions as well
You're great!!!!
hey Kevin can you please help us understand Task Schduler question . Leet code 621.
Definitely, I'll see if I can make a video on that one next week thanks for the suggestion!
easy peasy - but great content
haha easy is relative!!! Thanks :)