You are given a string s consisting only of '(' and ')', and an integer k.
A string is considered k-balanced if it contains exactly k consecutive '(' followed by k consecutive ')',
i.e., '(' * k + ')' * k.
For example:
• If k = 2, a k-balanced substring is "(())".
• If k = 3, a k-balanced substring is "((()))".
Your task is to repeatedly remove all non-overlapping k-balanced substrings from s, joining the remaining parts each time.
Continue this process until no more k-balanced substrings exist.
Finally, return the resulting string after all possible removals.
Input: s = "(()())" k = 1
Output: "()"
Input: s = "((()))" k = 3""
Output: ""
Accepted:
Submission: