Pregunta de entrevista de WeSquare

Algorithm explanation and construction in technical round.