Not getting the expected output

my code: https://ide.codingblocks.com/s/251863

What is wrong in this?

@princeky4 you are taking 2 inputs each time (in insert function) but as you can see in the given test case, you will get only 1 value. You dont need to make a complicated build function because it is mentioned that the max number of children is 3, so you can treat it as a regular binary tree.

I am getting the same answer . Can you correct it?

@princeky4 please share the modified code

modified code: https://ide.codingblocks.com/s/251886

@princeky4 your tree is not being constructed properly, you can see that by printing the tree.

@princeky4 refer this for build function https://ide.codingblocks.com/s/251927

Nothing change getting same answer code: https://ide.codingblocks.com/s/251886

@princeky4 try changing your approach for level order sum. Use a recursive approach, I have written a code here https://ide.codingblocks.com/s/251978 you can see the approach. Let me know if you still have any confusion.