Pergunta de entrevista da empresa Docusign

Standard leetcode coding challenge, with a variant