← 返回 salesforce 的题目列表Balanced String Advanced
类型:online_judge
salesforce
Given a string containing only the characters '(', ')', '{', '}', '[' and ']', your task is to remove the minimum number of characters to make all the brackets in the string balanced. You can output any valid result among all possible valid strings.
Input Format:
A single line input string, with length no greater than 10^4.
Output Format:
A single line output of a valid string.
Test cases:
Input: "a)bc(d)"
Output: "abc(d)"
Input: ")a(b[c)d("
Output: "a(b[c]d)"
Input: "(){}[]"
Output: "(){}[]"
Be aware, multiple valid outputs are possible.
Example
Input
a)bc(d)