Pregunta de entrevista de Huawei Technologies

One leetcode medium was not that hard