114. Flatten Binary Tree to Linked List

Description

Given a binary tree, flatten it to a linked list in-place.

Constraints

Approach

Examples

Input: [1, 2, 5, 3, 4, null, 6]

Output: [1, null, 2, null, 3, null, 4, null, 5, null, 6]

Solutions

Follow up

Last updated