Pregunta de entrevista de Amazon

coding problems similar to leetcode medium-hard