Re: [閒聊] 每日leetcode

作者: Rushia (みけねこ的鼻屎)   2024-04-21 12:44:37
https://leetcode.com/problems/find-if-path-exists-in-graph/description
1971. Find if Path Exists in Graph
給你一個陣列表示的圖,判斷 source 和 destination 是否連通。
思路:
1.把所有邊的點加到併查集,然後查這兩點有沒有連通就好。
py code:
作者: digua (地瓜)   2024-04-21 12:53:00
大師
作者: oinishere (是oin捏)   2024-04-21 13:09:00
大師

Links booklink

Contact Us: admin [ a t ] ucptt.com