Re: [閒聊] 每日leetcode

作者: smart0eddie (smart0eddie)   2024-06-27 08:17:46
1791. Find Center of Star Graph
There is an undirected star graph consisting of n nodes labeled from 1 to n.
A star graph is a graph where there is one center node and exactly n - 1
edges that connect the center node with every other node.
原本想說這題很簡單啊
所有node算一下誰的edge最多
然後時間跟別人比慢的要死
一看答案
靠北 直接取兩個edge 共通的node就好了
泥板只剩我不看答案連easy都不會了

Links booklink

Contact Us: admin [ a t ] ucptt.com