Help me out in this
yeah , let me see the question
what problem are you facing in this question?
@aa1 i understand the logic but how we can print the subtreess like it is shown in output
Input: root = [1,2,3,4,null,2,4,null,null,4]
Output: [[2,4],[4]]
we dont need to take care of printing it, we are just creating the arraylist and returning it
the driver function will handle it itself
@aa1 can you give your whatsapp number so that i can send you pic of testcase
where it creates confusion
you need to return above trees’ root in the form of a list
try to click a picture of the testcase and upload it here
sure, check your inbox