longest valid parenthesis reimpl