Algorithm · Oracle · Easy
You are given a binary tree in which every node stores either 0 or 1. Reading the values along any path from the root down to a leaf yields a binary number, where the root's value is the most significant bit and the leaf's value is the least significant bit. Compute and return the total obtained by adding together the numbers formed by every root-to-leaf path. A leaf is any node that has no children. Input and Output Input: a JSON object with a single field root, which…