Up&Up (NY) Interview Question

Graph traversal problem leetcode basic