엔지니어 게시판
LeetCode 솔루션 분류

[5/18] 1192. Critical Connections in a Network

컨텐츠 정보

본문

[LeetCode 시즌 3] 2022년 5월 18일 문제입니다.

https://leetcode.com/problems/critical-connections-in-a-network/


1192. Critical Connections in a Network
Hard
3627139Add to ListShare

There are n servers numbered from 0 to n - 1 connected by undirected server-to-server connections forming a network where connections[i] = [ai, bi] represents a connection between servers ai and bi. Any server can reach other servers directly or indirectly through the network.

critical connection is a connection that, if removed, will make some servers unable to reach some other server.

Return all critical connections in the network in any order.

 

Example 1:

Input: n = 4, connections = [[0,1],[1,2],[2,0],[1,3]]
Output: [[1,3]]
Explanation: [[3,1]] is also accepted.

Example 2:

Input: n = 2, connections = [[0,1]]
Output: [[0,1]]

 

Constraints:

  • 2 <= n <= 105
  • n - 1 <= connections.length <= 105
  • 0 <= ai, bi <= n - 1
  • ai != bi
  • There are no repeated connections.

관련자료

댓글 0
등록된 댓글이 없습니다.
전체 396 / 1 페이지
번호
제목
이름

최근글


인기글


새댓글


Stats


알림 0