Company: Bank of Australia
Difficulty: medium
Last Element of Each Level in an Almost Complete Binary Tree Problem Description Consider that you are provided with a list A of integers N. Construct an almost complete binary tree by using them and write a program to print the last number from each level that is completely filled. If the elements of the list L are [x1,x2,x3,x4, x5, x6, ..., x10] then the constructed almost complete 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 level (h stands for the number of levels) should be completely filled without any gap. Read the input from STDIN and print the output to STDOUT. Do not print arbitrary strings anywhere in the program, as these contribute to the standard output and test cases will fail. Examples Example 1: Input: 4 12 23 354 32 Output: 12 354 Explanation: From the given Sa