function criticalConnections(n, connections) {
  const critical = [];
  const graph = buildGraph(n, connections);
  // console.log({graph})

  for (let i = 0; i < connections.length; i++) { // O(|E| * [|V|^3 + |V|^2|E|]) = O(|V|^3|E| + |V|^2|E|^2)
    const link = connections[i];
    if (isLinkCritical(link, graph)) {
      critical.push(link);
    }
  }

  return critical;
}
@param {number} n
@param {number[][]} connections
@return {number[][]}