Mini Parser
medium
Given a string s represents the serialization of a nested list, implement a parser to deserialize it and return the deserialized NestedInteger. Each element is either an integer or a list whose elements may also be integers or other lists.
Constraints
1. 1 <= s.length <= 5 * 104 2. s consists of digits, square brackets "[]", negative sign '-', and commas ','. 3. s is the serialization of valid NestedInteger.
Format
Input
Input is managed for you
Output
Output is managed for you
Example
Sample Input
[123,[456,[789]]]
Sample Output
]
]
]
789
[
[
]
456
[
[
]
123
[