-
Notifications
You must be signed in to change notification settings - Fork 2
delimitersoup
bradendubois edited this page Nov 24, 2021
·
8 revisions
ID: delimitersoup
Difficulty: 2.2
CPU Time: 1 second
Memory: 1024 MB
Create a mapping between the pairs of braces: "(" to ")", etc. And when we read each character, do nothing if it's a space, push the character if it's a left bracket; if it's a right bracket, pop the top of the stack. If the stack is actually empty, or they do not match, output the read bracket and index / number read.