431. Encode N-ary Tree to Binary Tree

Problem

Design an encoding to convert an N-ary tree to a binary tree and back.

Design an algorithm to encode an N-ary tree to a binary tree, and decode it back. Each node in an N-ary tree can have multiple children, but in a binary tree each node has at most 2 children.

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

431. Encode N-ary Tree to Binary Tree

Design an encoding to convert an N-ary tree to a binary tree and back.