Valid parentheses js Open brackets must be closed by the same type of brackets.