solve longest valid parenthese