Sum of leaves
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given an array of integers. Create a Binary Search Tree from these numbers. If the number is already in the tree, do not insert it (no duplicates).
Find the sum of all leaves in a tree.
Input
The first line contains number . The second line contains integers.
Output
Create the Binary Search Tree from input data. Print the sum of all leaves in a tree.
Examples
The sum of leaves equals to .
Input #1
Answer #1
Submissions 29
Acceptance rate 41%