public class MultiBraceParenthesisValidator extends java.lang.Object implements ParenthesisValidator
ParenthesisValidator.ParenthesisEnum
Constructor and Description |
---|
MultiBraceParenthesisValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
isValidParenthesis(java.lang.String s)
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not. Solve in O(n) time and O(n) space. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isEmptyOrNull
public boolean isValidParenthesis(java.lang.String s)
isValidParenthesis
in interface ParenthesisValidator