Given a nested list of integers represented as a string, implement a parser to deserialize it.
Each element is either an integer, or a list – whose elements may also be integers or other lists.
Note: You may assume that the string is well-formed:
String is non-empty.
String does not contain white spaces.
String contains only digits 0-9, [, - ,, ].
Example 1:
Example 2:
解法1: Iterative
这题自己写的stack版本怎么也过不了OJ, 参考了这篇帖子的解法
C++
Java