Pregunta de entrevista de CareStack (Good Methods Global)

Suggest an algorithm to balance brackets in the most efficient way.