428. Serialize and Deserialize N-ary Tree

Problem

Design a serialization and deserialization algorithm for an N-ary tree.

Design an algorithm to serialize and deserialize an N-ary tree. In an N-ary tree, each node can have any number of children.

Serialize: Convert the tree to a string representation. Deserialize: Convert the string back to the original tree.

Examples
Input: [[],0]
Output: [0,0,0,0,0]
Hints
Related Problems

428. Serialize and Deserialize N-ary Tree

Design a serialization and deserialization algorithm for an N-ary tree.