Trees -- Find sum at level K Java

I have written the complete code to make the tree, along with printing the sum,
However, I am only able to take input as a continuous line of numbers, and not in the format specified in the question.
So, please tell me how do I take the input as specified by the question.
My code is:

Hi Aman,
You don’t have to use print statements while taking input.

Hi Aman

As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.