Docusign interview question

Standard leetcode coding challenge, with a variant