Simple Enough Explanation

From the question it is unclear that after expanding at each level are we supposed to discard the previous list.Like for example assume n=9 as given in the problem.
After first iteration we get the list [4 ,1, 4]
Now after second iteration will the list become-
[2, 0, 2, 2, 0, 2] ? one set of 2,0,2 belong to left most 4 and another set of 2,0,2 belong to rightmost 4 in the list [4, 1, 4]. This is my first question, the second question is, in the list 4,1,4 we expand 4’s but we dont expand 1, so will this 1 be present in my final list when all elements are turned to 0 or 1. i.e will the final list contain only 0s and 1s? and if so will this list contain the 1 which was derived at level 1 i.e after expanding 9 to 4,1,4.

9 - [4,1,4]
[4,1,4] - [2,0,2,2,0,2]
[2,0,2,2,0,2] - [1,0,1,1,0,1,1,0,1,1,0,1] is this the final list? or is it this one -
[101010111011101] this list includes all ones that have been found before, this is obatined on preorder traversal of the tree.
Or if there is something else that this plz explain with sample input.
Thank you.

it is wholly on divide and conquer approach, every recursive call is begin divided into 3 parts, and then you have to maintain whether it will be 1,0 with an extra vairable, think before going to editorial bcz it is a really good question and simple enough

You didnt answer what i asked did you even read what i asked? Is the way i understood the question correct or not. I didnt ask how to solve it. i just asked how the answer 3 was generated. I gave the step by step explanation of what i understood. I don’t see anywhere asking for a solution. Just asking how three was generated and i gave all the intermediate nodes which I THINK would be generated if i understood the question propely. Please answer the things i asked.

@Saurabh-Kumar-1331476656958199 Please Answer.

bro in your second step , woh 1 will be in the place onlny

4 1 4
2 0 2 1 2 0 2
1 0 1 0 1 0 1 1 1 0 1 0 1 0 1

we will never divide 1 and 0 here , only number greater than 1 will be divided by(n/2,n%2,n/2) and them we will replplace them