Meta Interview Question

basic graph problem found on leetcode