Skip to content

Commit

Permalink
Create CenterOfGraph.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitiz11101 authored Jun 27, 2024
1 parent ee1b711 commit 3f30063
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Graphs/CenterOfGraph.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Solution {
public:
int findCenter(vector<vector<int>>& edges) {
if(edges[0][0]==edges[1][0] || edges[0][0]==edges[1][1]){
return edges[0][0];
}
return edges[0][1];
}
};

0 comments on commit 3f30063

Please sign in to comment.