Algorithm · Meta · Hard
A string s is given. It contains ordinary letter characters together with the six bracket characters (, ), [, ], {, and }. You may delete only bracket characters. Remove as few of them as possible so that the bracket characters left in the string form a valid bracket sequence. A valid bracket sequence must satisfy these rules: Matching brackets must have the same type: ( closes with ), [ closes with ], and { closes with }. Pairs must be nested rather than interleaved; for…
Checking your access…