Pregunta de entrevista de Amazon

Leetcode Hard Question was asked