You are viewing a single comment's thread. Return to all comments →
Everytime your stack becomes empty you have read an even number of characters. Therefore it's sufficient to check the length once.
Stacks: Balanced Brackets
You are viewing a single comment's thread. Return to all comments →
Everytime your stack becomes empty you have read an even number of characters. Therefore it's sufficient to check the length once.