Autodesk interview question

Leetcode problem mainly focus on graph and Matrix