Pergunta de entrevista da empresa Razorpay

2b. Given a binary tree, flatten the binary tree into one dimension in such a way that the order in which one can access the elements is the same as a preorder traversal and only the left child nodes can contain values, the right child has to point NULL.