Problem 3703 · Medium

Remove K-Balanced Substrings

Push characters onto a stack and delete the top block whenever it reads k opening then k closing parentheses.

Open the interactive visualisation