1791. Find Center of Star Graph
class Solution {
public:
int findCenter(vector<vector<int>>& edges)
{
vector<int> first = edges[0], second = edges[1];
return (first[0] == second[0] || first[0] == second[1]) ? first[0] : first[1];
}
};
- T:
- S: