Pergunta de entrevista da empresa Accenture

They asked me to solve a real-world coding problem by optimizing the solution for both time and space complexity, while explaining my thought process throughout the implementation.