Salesforce interview question

Graph traversal easy leetcode problem