Deserialize example
Input
'1,2,3,null,4,5'
Output
[1, 2, 3, None, 4, 5]
Reconstruct the tree and represent it as a level-order list with None for missing children.
Full lesson preview
Reconstruct a binary tree from its level-order string representation.
Problem statement
Task
Examples
Input
'1,2,3,null,4,5'
Output
[1, 2, 3, None, 4, 5]
Reconstruct the tree and represent it as a level-order list with None for missing children.
Input format
Output format
Constraints
Samples
Input
'1,2,3,4,5,6,7'
Output
[1, 2, 3, 4, 5, 6, 7]
Perfect binary tree reconstructs with all nodes present.