Pregunta de entrevista de ShipBob

coding problem on balance parenthesis along with a variation.