Question
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum = 22,
return
Explanation
递归的时候保留路径,满足就存入全局变量中。
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum = 22,
return
递归的时候保留路径,满足就存入全局变量中。