3 ms·
I noticed on the 'Validate string with open/close is well formed' question an edge case that's not handled. If the input has a trailing closer char with an unma
by Jach 13y ago
I noticed on the 'Validate string with open/close is well formed' question an edge case that's not handled. If the input has a trailing closer char with an unmatched opener, an IndexError will be raised because the stack will be empty when you try to pop from it. (Unless your particular Stack class just returns None or something? But then you'll get a KeyError when trying to access that key in the dict.)