Pergunta de entrevista da empresa Glassdoor

Leet code medium but more time consuming.