Pregunta de entrevista de Chubb

solution for brackets are valid or not.