Practice Mini Parser
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
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.
Source: Mini Parser on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
s = "324"
Output
324
# Example 2
Input
s = "[123,[456,[789]]]"
Output
[123,[456,[789]]]
Constraints
1 <= s.length <= 5 * 10^4
s consists of digits, square brackets "[]", negative sign '-', and commas ','.
s is the serialization of valid NestedInteger.
All the values in the input are in the range [-10^6, 10^6].
Related LeetCode Problems
Practice more problems similar to Mini Parser.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.