Given an array of integers. Create a Binary Search Tree from these numbers. If the inserted value equals the current node, insert it into the right subtree.
Implement the method SumLeft, which returns the sum of all left leaves in the tree.

Write the code according to the following interface:
class TreeNode
{
public:
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Tree
{
public:
TreeNode *head;
Tree() : head(NULL) {};
void Insert(int val); // Insert value val into the Binary Search Tree
int SumLeft(void); // Return the sum of all left leaves in the tree
};You can create (use) additional methods if necessary.
The first line contains the number (1 \le n \le 100). The second line contains integers.
Create a Binary Search Tree from the input data. Print the sum of all left leaves in the tree. If the tree does not contain left leaves, print 0.
Örnek 1