Just count I guess. +1 for every opening parentheses, -1 for every closeing one. Balance should always be >= 0, otherwise ")(" would be legal, and in the end, balance=0. Different counters for different types of parens.
If "([)]" is illegal then it's more complicated.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Just count I guess. +1 for every opening parentheses, -1 for every closeing one. Balance should always be >= 0, otherwise ")(" would be legal, and in the end, balance=0. Different counters for different types of parens.
If "([)]" is illegal then it's more complicated.