# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Limits
1s, 512 MB

Given a sequence of opening and closing parentheses (“(” and “)”) you will have to determine if it is a valid one.

A sequence of parentheses is considered valid if every opened parenthesis has a closing parenthesis appearing after it. And, there are no unpaired parenthesis in the sequence.

The input will contain a string of opening and closing parentheses. The string will be no longer than 25 characters.

Print “Yes” if the input string contains a valid sequence of parentheses. Otherwise, print “No”.

Input | Output |
---|---|

((()( | No |

Input | Output |
---|---|

((()())) | Yes |

80% Solution Ratio

YouKnowWhoEarliest,

YouKnowWhoFastest, 0.0s

Cloud_Lightest, 0 B

touhidurShortest, 70B

Login to submit

Tough Dash, March 2019 Ended |