Cadence Sound Interview Question

Q: Same as Leetcode #283