You are viewing a single comment's thread. Return to all comments →
I would also like to add-
if(expression.length() % 2 != 0) { return false; }
as if the number of brackets are balanced then the length of string will be even.
Seems like cookies are disabled on this browser, please enable them to open this website
Stacks: Balanced Brackets
You are viewing a single comment's thread. Return to all comments →
I would also like to add-
as if the number of brackets are balanced then the length of string will be even.