We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
第一刷记录:
失败: 对input没搞清楚,题目的Example是graph,所以很顺其自然的想到创建Graph上面,我思路是创建一个graph,然后寻找没有neighbor的node,和下面的方法high level上没有太大的出路
class Solution(object): def findCelebrity(self, n): celeb = 0 for i in range(1, n): if knows(celeb, i): celeb = i for i in range(n): if i == celeb: continue if knows(celeb, i): return -1 if not knows(i, celeb): return -1 return celeb
The text was updated successfully, but these errors were encountered:
No branches or pull requests
第一刷记录:
失败: 对input没搞清楚,题目的Example是graph,所以很顺其自然的想到创建Graph上面,我思路是创建一个graph,然后寻找没有neighbor的node,和下面的方法high level上没有太大的出路
The text was updated successfully, but these errors were encountered: