diff --git "a/leetcode3/\354\240\225\354\247\204\354\230\201/385. Mini Parser" "b/leetcode3/\354\240\225\354\247\204\354\230\201/385. Mini Parser" new file mode 100644 index 000000000..0ec6dd05b --- /dev/null +++ "b/leetcode3/\354\240\225\354\247\204\354\230\201/385. Mini Parser" @@ -0,0 +1,51 @@ +/** + * // This is the interface that allows for creating nested lists. + * // You should not implement it, or speculate about its implementation + * function NestedInteger() { + * + * Return true if this NestedInteger holds a single integer, rather than a nested list. + * @return {boolean} + * this.isInteger = function() { + * ... + * }; + * + * Return the single integer that this NestedInteger holds, if it holds a single integer + * Return null if this NestedInteger holds a nested list + * @return {integer} + * this.getInteger = function() { + * ... + * }; + * + * Set this NestedInteger to hold a single integer equal to value. + * @return {void} + * this.setInteger = function(value) { + * ... + * }; + * + * Set this NestedInteger to hold a nested list and adds a nested integer elem to it. + * @return {void} + * this.add = function(elem) { + * ... + * }; + * + * Return the nested list that this NestedInteger holds, if it holds a nested list + * Return null if this NestedInteger holds a single integer + * @return {NestedInteger[]} + * this.getList = function() { + * ... + * }; + * }; + */ +/** + * @param {string} s + * @return {NestedInteger} + */ +var deserialize = function(s) { + const stack = []; + let num = ""; + + for (let i = 0; i0 && grid[i][j-1] == 1){ + count -= 1; + } if (i>0 && grid[i-1][j] == 1){ + count -= 1; + } if (j