Pregunta de entrevista de Apple

Build a component in react to accomplish task