-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed as not planned
Labels
Description
What would you like to share?
In #492, the algorithm for checking parenthesis seems to be redundant, as it merely checks if all the opened parenthesis are closed or not. Instead, a better algorithm would be to check if the parenthesis is valid or balanced, which is a very standard algorithm.
Extra issue details
For example, in the parenthesis sequence )))(((, the current algorithm would return true as initially, the parcounter is decremented due to ) and then later incremented, eventually becoming 0, but this is invalid as the ) has started before (.
Additional information
No response