Leetcode 2368. Reachable Nodes With Restrictions | Hello Interview