Pregunta de entrevista de Intuit

leetcode medium hard question was asked.