这在 O(n) 中非常简单,但我被要求在小于 O(n) 的时间复杂度内完成。
例如
{({})} is a valid string because each type of opening brace has a matching closing brace.
while for {{{{)))} this is not as braces doesn't match
这在 O(n) 中非常简单,但我被要求在小于 O(n) 的时间复杂度内完成。
例如
{({})} is a valid string because each type of opening brace has a matching closing brace.
while for {{{{)))} this is not as braces doesn't match