/Arithmetic-Tree

Calculates the result of an arithmetic tree with addition and multiplication, including for more than two child nodes

Primary LanguagePythonApache License 2.0Apache-2.0

Arithmetic-Tree

Calculates the result of an arithmetic tree with addition and multiplication, including for more than two child nodes Takes input as a comma separated predecessor list, and another comma separated list of the node’s value (for leaves) or operator (for non-leaves). e.g.

Input: -1,0,0,0,1,1,1 +,*,7,23,19,0,6

Output: 30