Limits
1s, 512 MB

This problem is matching brackets, but with regular expression.

Given a set of parenthesis, if they are balanced, print it. If not, leave the output empty.

A line with a set of opening and closing parentheses. There will be at most 200 parenthesis.

If the entire set of parentheses is balanced, the output should contain the entire set of parentheses. Otherwise, the output should be empty.

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

(()) | (()) |

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

()() | ()() |

Login to submit.

57%
Solution Ratio

jackal_1586Earliest,

Kuddus.6068Fastest, 0.0s

nusuBotLightest, 4.9 MB

jackal_1586Shortest, 24B

Toph uses cookies. By continuing you agree to our Cookie Policy.