Easy DFS. Possibly O(n)?