less than 1 minute read

Given a binary tree root, convert it to a singly linked list using level order traversal.

Constraints

  • 1 ≤ n ≤ 100,000 where n is the number of nodes in root

https://binarysearch.com/problems/Level-Order-Binary-Tree-to-Linked-List

Examples

Example 1

Input

  • root =

Output

  • answer =

Example 2

Input

  • root =

Output

  • answer =

Solution

Leave a comment