Merge Two Binary Trees

This is a LeetCode problem (617). Let’s say we have the following two binary trees: Upon merging them, we should get this as the final result: What this means is: If two nodes overlap, return the sum of those nodes. Before looking at the solution, have a look at how a TreeNode is defined: Note […]