Articulation Points
Given vertexCount vertices numbered 0 through vertexCount-1 and an undirected adjacency list, return all articulation vertices in ascending order. Removing an…
Given vertexCount vertices numbered 0 through vertexCount-1 and an undirected adjacency list, return all articulation vertices in ascending order. Removing an articulation vertex and its incident edges increases the total number of connected components compared with the original graph. The graph may already be disconnected. Return exactly [-1] if there is no articulation vertex.
- 1 <= vertexCount <= 10000 - adjacency has exactly vertexCount rows containing integer IDs in 0..vertexCount-1 - 1 <= the number of undirected edges <= 10000 - For distinct vertices u and v, u's occurrences of v and v's occurrences of u must have equal multiplicity - Row order is arbitrary; parallel edges, self-loops, disconnected components and isolated vertices are allowed - A self-loop may be represented by one or two self-neighbor entries. The edge bound is satisfied when at least one such interpretation meets it; rows are never rewritten - The preset visualizer uses at most 24 vertices and 48 undirected edges; larger valid inputs remain execution-only
Example 1: input vertexCount = 6, adjacency = [[1,2],[0,2],[0,1,3],[2,4,5],[3],[3]]; output [2,3]. Removing 2 separates the triangle's other vertices from the branch. Removing 3 separates vertices 4 and 5 from the triangle. Removing either other triangle vertex leaves the rest connected.
Example 2: input vertexCount = 3, adjacency = [[1,2],[0,2],[0,1]]; output [-1]. Removing any one vertex leaves the other two joined. No deletion increases the component count.
Category: Graphs. Topic: graph. Difficulty: Hard. Patterns: graph-traversal.