3 ms·
Your solution is actually an optimized implementation of a pushdown automata. nesting_depth is the stack. There is only one kind of symbol that can be pushed,
by munificent 8y ago
Your solution is actually an optimized implementation of a pushdown automata.
nesting_depth is the stack. There is only one kind of symbol that can be pushed, so it's represented as a simple count of the number of symbols that are on the stack.
- kerkeslager 8y agoOkay, but I don't need to know the concept of a PDA to implement that, nor would I assume a candidate understands PDAs from reading that code.