Company: Nobroker
Difficulty: medium
26 Language Coding Coding 1 Marks: 15 Consider that you are provided with a list A of N integers. Construct an almost complete binary tree by using the elements of A and write a program to print the sum of all the last numbers from each level that are completely filled. If the elements of the list L are [x1,x2,x3,x4, x5, x6, .., x10] then the constructed almost binary tree would be in the following manner. An almost complete binary tree is a binary tree that satisfies the following conditions: Insertion of nodes must take place level by level and all the nodes must be left justified. All the levels from 1 to h-1 levels(h stands for the number of levels) should be completely filled without any gaps. Constraints List A should not have any negative numbers Input Format The first line of input contains N where N denotes the total number of elements in the list A. The second line of input contains N elements separated by a single white space. Output Format A single line of output contains t