Kevin, this is no joke, but found your channel at a time that i needed to sharpen my interview skills so bad and have been following you for a while now. I honestly could not have been so disciplined on leetcode if i did not find your channel. I always try to drop a comment but this time wanted to truly thank you.
I have a phone google interview in an hour and I wish I found your channel a few months ago... Thank you for this awesome content. You are the best at explaining concepts! You make it look very easy:)
Thanks so much Marina and best of luck on your phone screen! Let me know how it goes! A couple last minute tips if you’re interested... 1. Don’t do anything until you understand the problem entirely! 2. Ask clarifying questions - companies want to see you think before you code and think about edge cases! 3. Once you finish writing you code don’t assume it’s right! Run a couple test cases on it if possible as well as talk through the logic of your code line by line out loud (it’s like proof reading an essay, if there’s a mistake chances are you’ll catch it while reading out loud) 4. Be confident you can do this!!!!
@@KevinNaughtonJr The fact that you take the time to reply to these comments made me subscribe. New to this myself, in a way it kind of feels like doing your SATs, in that you try to recognize the type of problem, and apply a solution.
Had this asked in an interview just now. A variation about similarity (nodes can be swapped). Forgot to code in the half-swapped cases, but thats life! Thanks Kevin!
@@KevinNaughtonJr I actually had a question to ask! I recently came across it in a coding challenge. If we're given an array where each item in the array is a fountain and max a fountain can spray (its range) is min(i + a[i], n) where n is the length of the array, what is the minimum number of fountains needed to be turned on to cover the entire array? An example is [1, 1, 1, 2, 3, 1, 1, 1], n = 8 and the answer would be one since the 4th index i = 3 would give 3 + 2 = 5 and 5 on each side would cover the entire array. I have no clue on how to approach this and have been racking my brain. I know it requires a dp solution as it's very similar to the tower hop problem or the min number of jumps problem.
Trees solutions with recursion are pretty trivial, we should concentrate more using Stacks or Queues for solving the tree problems, and that's what the interviewer expects. Gave an onsite interview with one of the BIG 5 and first thing the interviewer tells you with tree problems is "No Recursive Solution Please !". Please don't block me. :)
Hey Kevin, can you do "All Possible Full Binary Trees" on LC when you get a chance? There aren't many good solutions on LC and no one really has done a video on this problem before. It's an interesting problem, but I can't grasp the concept because it's recursive heavy and I think has some DP mixed in?
11 DAYS TILL GAME OF THRONES IF YOU DON'T WATCH EITHER START OR LOSE MY NUMBER
flopped
hahhahahhah
Kevin, this is no joke, but found your channel at a time that i needed to sharpen my interview skills so bad and have been following you for a while now. I honestly could not have been so disciplined on leetcode if i did not find your channel. I always try to drop a comment but this time wanted to truly thank you.
Thank you so much that means so much to me I really appreciate it! Stick with it it'll pay off in the end!!!
I just love the background music and the styling of your videos. great job!
Thanks so much Saloni I really appreciate the support!!!
This was so enlightening. When you were explaining the base case, recursion suddenly clicked! Thanks Kevin!
I have a phone google interview in an hour and I wish I found your channel a few months ago... Thank you for this awesome content. You are the best at explaining concepts! You make it look very easy:)
Thanks so much Marina and best of luck on your phone screen! Let me know how it goes! A couple last minute tips if you’re interested...
1. Don’t do anything until you understand the problem entirely!
2. Ask clarifying questions - companies want to see you think before you code and think about edge cases!
3. Once you finish writing you code don’t assume it’s right! Run a couple test cases on it if possible as well as talk through the logic of your code line by line out loud (it’s like proof reading an essay, if there’s a mistake chances are you’ll catch it while reading out loud)
4. Be confident you can do this!!!!
@@KevinNaughtonJr The fact that you take the time to reply to these comments made me subscribe. New to this myself, in a way it kind of feels like doing your SATs, in that you try to recognize the type of problem, and apply a solution.
Had this asked in an interview just now. A variation about similarity (nodes can be swapped). Forgot to code in the half-swapped cases, but thats life! Thanks Kevin!
thank you for your clear walk throughs on these challenges. great help!
Thanks Dude!
Still remember the scenario that "Recursion just like you are watching a movie in the cinema "
Keep up the good work ma man, you helping a lot of us out here ✌
Love the reference to StackOverflow w/ logo!
haha thanks Ben :)
The Game of Thrones excitement didn't age well 😂😂😂
Thanks for the video. Helpful 👍
Hate these kinds of problems from the bottom of my heart. Don't even have a motivation to read the problem when I see Node, List etc.
your channel is dope brother, thanks a lot
simple and understandable , thanks.
Hey Kevin love the videos can you do more leetcode mediums I feel like in interviews I never encounter easy problems it’s always mediums
Hey Anthony thanks so much and you've got it!!!
Only if I could solve problems during an interview this easily. So difficult to remain calm during an interview
:-(
It's tough Salonee, don't beat yourself up, just keep practicing! :)
I like ur presentation skills ,simply superb keep rocking
So glad you mentioned runtime. I actually followed the solution this time haha.
Haha I FINALLY remembered!!! Awesome I'm happy to hear the solution made sense :)
@@KevinNaughtonJr I actually had a question to ask! I recently came across it in a coding challenge. If we're given an array where each item in the array is a fountain and max a fountain can spray (its range) is min(i + a[i], n) where n is the length of the array, what is the minimum number of fountains needed to be turned on to cover the entire array? An example is [1, 1, 1, 2, 3, 1, 1, 1], n = 8 and the answer would be one since the 4th index i = 3 would give 3 + 2 = 5 and 5 on each side would cover the entire array. I have no clue on how to approach this and have been racking my brain. I know it requires a dp solution as it's very similar to the tower hop problem or the min number of jumps problem.
who was google asking same tree to? the service dogs ??
Please make more videos on Dynamic Programming !
Tree problems we're what stumped me during my Amazon interview a few months ago (can't give the exact problems due to NDA)
No worries and yeah tree problems are tough
Trees solutions with recursion are pretty trivial, we should concentrate more using Stacks or Queues for solving the tree problems, and that's what the interviewer expects. Gave an onsite interview with one of the BIG 5 and first thing the interviewer tells you with tree problems is "No Recursive Solution Please !". Please don't block me. :)
Hey Kevin, can you do "All Possible Full Binary Trees" on LC when you get a chance? There aren't many good solutions on LC and no one really has done a video on this problem before. It's an interesting problem, but I can't grasp the concept because it's recursive heavy and I think has some DP mixed in?
Hi, Thank you for your videos. It's been extremely helpful. Can you please make an video on Lettcode#498. Diagonal traversal.
Anytime and thanks for the suggestion I'll see what I can do!
Nice Video, What made you choose software engineering as your career path?
Thanks Spark! I just liked video games when I was younger so I was interested in programming so I gave it a shot in college and loved it
How many tries did you do?
Thanks
What is the space complexity for this recursion method?
Kevin , i want is to give me exemple of param TreeNode p and q to pass it through isSameTree(p, q) function to excute it in other IDE THanks
You make it super easy..❤️
Good shit bro, have a coding challenge to do from Google, hope it's not too bad
Thanks man really appreciate it! Good luck and lmk if there's anything I can do to help you prepare, you got this!!!
Also do you know if there is an iterative solution to this problem
You can always write thing iteratively or recursively!
U r GOD!
Fabb...
Same logic could be simply more compactly written as below
```
public boolean isSameTree(TreeNode p, TreeNode q) {
if ((p == null) && (q == null)) return true;
if ((p == null) || (q == null)) return false;
return (p.val != q.val) ? false : isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
}
```
do more problems on graphs and bit manipulation , i have learnt the implementation concept of trees from your videos only
Hello! My dream is to become a software engineer in the future.
You can do it!!!!
Nice use of else if for implementing logic
Wrong link to problem, fix it kevin
just updated thanks for letting me know