Grokking Data Structures & Algorithms for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
Aravind Badiger
We could do it without creating new node, but adding the values into one tree from other

Aravind Badiger

Dec 9, 2024

We could do it without creating new node, but adding the values into one tree from other

1

0

Comments
Comments
Crack Jack
Crack Jack16 days ago
# I could have been simpler, but I did something like this: class Solution:     def traverse(self, p1, p2, t1, t2, side):         if not (t1 or t2):             return         if t1 and t2:             t1.val += t2.val             self.traverse(t1, t2, t1.lef...