Skip to content

Commit

Permalink
Create find-center-of-star-graph.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 authored Mar 14, 2021
1 parent d32d571 commit c6f1228
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Python/find-center-of-star-graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Time: O(1)
# Space: O(1)

class Solution(object):
def findCenter(self, edges):
"""
:type edges: List[List[int]]
:rtype: int
"""
return edges[0][edges[0][1] in edges[1]]

0 comments on commit c6f1228

Please sign in to comment.