Validate a bracket string after digit-driven deletions

0
Remix

A string mixes brackets and digits, for example (())2)1(). Each digit d requires removing exactly d of the brackets that come before it. Decide whether the deletions can be chosen so the remaining brackets are balanced. Agree on the exact rules with the interviewer, then work out a greedy or stack-based check.

GoogleCodingLast asked Aug 2025
No answer yet. Write the first one; the best answer gets endorsed.