Add accepted solution for valid parentheses.