Autodesk interview question

Leetcode questions medium difficulty can be found online