Skip to content

Commit

Permalink
Update Balanced parentheses.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pravahanj authored Nov 13, 2021
1 parent be4ba9f commit 2fb9a58
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Stacks and Queues/Balanced parentheses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ false
Explanation to Sample Input 2:
The initial two pairs of brackets are balanced. But when you see, the opening bracket at the fourth index doesn't have its
corresponding closing bracket which makes it imbalanced and in turn, making the whole expression imbalanced.
corresponding closing bracket which makes it imbalanced and in turn, making the whole expression imbalanced.Hence the
output prints 'false'.
*/

#include <stack>
Expand Down Expand Up @@ -83,5 +84,3 @@ bool isBalanced(string str) {
return s.empty();

}
Hence the output prints 'false'.
*/

0 comments on commit 2fb9a58

Please sign in to comment.