Pregunta de entrevista de Amazon

To code a solution to leetcode style question