As the generator creates a tree with the nodes, it could make mistakes when handling minus and plus.
4-(3+5) eq -4
The left part will be output as
4-3+5, which has the correct answer 6
Generated from the code:
[9+40_8+30-39_31+40, -890]
The correct answer is -810.