Docusign Interview Question

Standard leetcode coding challenge, with a variant