Count articulation points

Write codeHard35 min

Your task

Given an undirected simple graph on n nodes (0..n-1) as edges [u, v] (no self loops or parallel edges), return the number of articulation points (cut vertices): nodes whose removal (with their incident edges) increases the number of connected components. Constraints: 1 <= n <= 60.

Examples

count_articulation(n: int, edges: list[list[int]]) -> int
Example 1
Inputcount_articulation(5, [[0, 1], [1, 2], [2, 0], [2, 3], [3, 4]])
Output2