257. Binary Tree Paths
# Easy
Not easy. Hard to think. Two cases are needed to consider in helper
function.
root
doesn't have any child, then this path completesroot
is empty, then this path is invalid.
List1 = [1, 2, 3], List2 = [2, 4, 6]. List1 + List2 = [1, 2, 3, 2, 4, 6]
So in the implementation below, List1 = ['1->2->5'], List2 = ['1->3']
, then List1+List2 = [['1->2->5'], ['1->3']].
Last updated