Find the articulation point · Compiler

Find the articulation point

Find every vertex whose removal, together with its incident edges, increases the number of connected components of the entire undirected graph. The input graph may already have several components.

Input
The first line contains n and m (1 <= n <= 50, 0 <= m <= n*(n-1)/2). Vertices are numbered 1 through n. Each of the next m lines contains the two endpoints of one undirected edge. There are no self-loops or repeated edges.
Output
Print all qualifying vertex numbers in increasing order, separated by spaces. If there are none, print NONE.

Compiler Explorer runs your code when you run or check it.

Loading your exercise draft…