Pergunta de entrevista da empresa Amazon

Leet code Medium problem and Hard Problem