Path Sum II - LeetCode 113 - JavaScript

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


Step by step walk through of the solution to the popular Amazon coding interview question, Path Sum II.

LeetCode 113

JavaScript

0:00 Intro
0:43 Explanation
6:16 Code

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

A bit confused on the backtracking implementation. When the recursive function gets to the node containing 7, the currentSum will be 27 and line 29 and 30 would return an empty array. How does the backtracking on line 32 change the currentSum and take it back to the node that contains the value 11, and how do you then go to the right of the node that contains 11. Sorry If this is too verbose.

omotoshojoseph
visit shbcf.ru