Title: #385 - Mini Parser - LeetCode JavaScript Solutions
Open Graph Title: #385 - Mini Parser - LeetCode JavaScript Solutions
X Title: #385 - Mini Parser - LeetCode JavaScript Solutions
Description: Given a string s represents the serialization of a nested list, implement a parser to deserialize it and return the deserialized NestedInteg...
Open Graph Description: Given a string s represents the serialization of a nested list, implement a parser to deserialize it and return the deserialized NestedInteg...
X Description: Given a string s represents the serialization of a nested list, implement a parser to deserialize it and return the deserialized NestedInteg...
Keywords:
Opengraph URL: https://leetcodejavascript.com/solutions/mini-parser
Domain: leetcodejavascript.com
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/mini-parser","name":"#385 - Mini Parser - LeetCode JavaScript Solutions","description":"Given a string s represents the serialization of a nested list, implement a parser to deserialize it and return the deserialized NestedInteg...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * @param {string} s\n * @return {NestedInteger}\n */\nvar deserialize = function(s) {\n return traverse(JSON.parse(s));\n\n function traverse(str) {\n if (Number.isInteger(str)) {\n return new NestedInteger(str);\n }\n const value = new NestedInteger();\n for (const s of str) {\n value.add(traverse(s));\n }\n return value;\n };\n};","keywords":"LeetCode 385, #385 - Mini Parser, Medium, JavaScript solution","learningResourceType":"Code","isAccessibleForFree":true,"educationalLevel":"intermediate","interactivityType":"mixed"}
| author | LeetCodeJavascript.com |
| og:type | article |
| og:image | https://leetcodejavascript.com/og-image.jpg |
| og:site_name | LeetCode JavaScript Solutions |
| twitter:card | summary_large_image |
| twitter:url | https://leetcodejavascript.com/solutions/mini-parser |
| twitter:image | https://leetcodejavascript.com/og-image.jpg |
| twitter:creator | @joshcrozier |
| theme-color | #1f2937 |
Links:
| LeetCodeJavascript.com | https://leetcodejavascript.com/ |
| Star on GitHub | https://github.com/JoshCrozier/leetcode-javascript |
| Back to all solutions | https://leetcodejavascript.com |
| View on LeetCode | https://leetcode.com/problems/mini-parser/ |
| View on GitHub | https://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/0385-mini-parser.js |
| String | https://leetcodejavascript.com/tags/string |
| Depth-First Search | https://leetcodejavascript.com/tags/depth-first-search |
| Stack | https://leetcodejavascript.com/tags/stack |
| Josh Crozier | https://joshcrozier.com |
Viewport: width=device-width,initial-scale=1
Robots: index, follow