Given a string of parentheses and alphanumeric characters, return a valid balanced string.
In a valid string for every opening/closing parentheses there is a matching closing/opening one.
Possible valid output: ab(a()fg)9, another valid option might be: ab(a(c)fg9).
The goal is to return a valid string in the most optimised way both memory and time vice.
How can you use the fact that the string is alphanumeric?