Pregunta de entrevista de Circle Internet Financial

Solve the given problem in react