(Old) Leetcode 112 - Binary Tree | Path Sum

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

Code:

Leetcode:

*Note* I claim no rights to this question. All rights belong to Leetcode. If I'm reviewing a solution that was from another Leetcode user or Leetcode itself I will give credit below.

Credit to :

Hey there! Just wanted to let you know that some of the below links in this video description are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own!

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


Hey there! Just wanted to let you know that some of the links in this comment are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own!

NideeshTerapalli
Автор

Great Explanation. I always get confused struggle with recursion while tracing it back. Thanks!

RED-piwo
Автор

Maybe add a condition to return false if the sum is already bigger than the current val so it stops from going further if the tree is too deeep?

LuisHoracioGonzalez
Автор

When you first pass the function, it should be 22, 0. Not 22.5, you were explaining it correct and then took a wrong turn

uguryilmaz
welcome to shbcf.ru