Problem:
You are given an undirected connected graph with N vertices and M edges that does not contain self-loops and double edges.   The i-th edge (1 \leq i \leq M) connects Vertex a_i and Vertex b_i.  An edge whose removal disconnects the graph is called a _bridge_.   Find the number of the edges that are bridges among the M edges.

Incorrect submission (verdict: Wrong Answer):
import numpy as np
import math

# K = int(input())
# N, K = map(int, input().split())
# A = list(map(int, input().split()))

N, M = map(int, input().split())

E = np.zeros((N, N), dtype=int)

for m in range(M):
    s, t = map(int, input().split())
    s = s-1
    t = t-1
    E[s][t] = 1
    E[t][s] = 1

# print(E)
    
bridges = set()
TIME = 0
    
def bridgeN(n, visited, parent, low, dis):
    global TIME
    visited[n] = 1
    dis[n] = TIME
    low[n] = TIME
    TIME += 1

    # print('time', TIME)

    # print('n=', n)
    # print('visited=', visited)
    
    for v in range(N):
        if E[n][v] == 0:
            continue
        if visited[v] == 1:
            if v != parent[n]:
                low[n] = min(low[n], dis[v])
            continue

        print('visited[', v, ']=', visited[v])
        
        parent[v] = n
        bridgeN(v, visited, parent, low, dis)

        low[n] = min(low[n], low[v])

        if low[v] > dis[n]:
            if v <= n:
                bridges.add((v, n))
            else:
                bridges.add((n, v))
                

def bridge(E):
    visited = np.zeros(N, dtype=int)
    dis = np.full_like(visited, N*N*10)
    low = np.full_like(visited, N*N*10)
    parent = np.full_like(visited, -1)

    for n in range(N):
        if visited[n] == 0:
            bridgeN(n, visited, parent, low, dis)

bridge(E)
nBridges = len(bridges)
# print(bridges)

print(nBridges)



Fixed, accepted submission:
import numpy as np
import math

# K = int(input())
# N, K = map(int, input().split())
# A = list(map(int, input().split()))

N, M = map(int, input().split())

E = np.zeros((N, N), dtype=int)

for m in range(M):
    s, t = map(int, input().split())
    s = s-1
    t = t-1
    E[s][t] = 1
    E[t][s] = 1

# print(E)
    
bridges = set()
TIME = 0
    
def bridgeN(n, visited, parent, low, dis):
    global TIME
    visited[n] = 1
    dis[n] = TIME
    low[n] = TIME
    TIME += 1

    # print('time', TIME)

    # print('n=', n)
    # print('visited=', visited)
    
    for v in range(N):
        if E[n][v] == 0:
            continue
        if visited[v] == 1:
            if v != parent[n]:
                low[n] = min(low[n], dis[v])
            continue

        # print('visited[', v, ']=', visited[v])
        
        parent[v] = n
        bridgeN(v, visited, parent, low, dis)

        low[n] = min(low[n], low[v])

        if low[v] > dis[n]:
            if v <= n:
                bridges.add((v, n))
            else:
                bridges.add((n, v))
                

def bridge(E):
    visited = np.zeros(N, dtype=int)
    dis = np.full_like(visited, N*N*10)
    low = np.full_like(visited, N*N*10)
    parent = np.full_like(visited, -1)

    for n in range(N):
        if visited[n] == 0:
            bridgeN(n, visited, parent, low, dis)

bridge(E)
nBridges = len(bridges)
# print(bridges)

print(nBridges)