Skip to content

Comments

Graph-1 done#787

Open
ManishaRana1195 wants to merge 1 commit intosuper30admin:masterfrom
ManishaRana1195:master
Open

Graph-1 done#787
ManishaRana1195 wants to merge 1 commit intosuper30admin:masterfrom
ManishaRana1195:master

Conversation

@ManishaRana1195
Copy link

No description provided.

@super30admin
Copy link
Owner

Your solution for the town judge problem is excellent. It correctly implements the indegree approach with optimal time and space complexity. The code is clear and well-commented. One minor note: the variable name "trusts" in the method parameter might be better named as "trust" to match the problem statement, but this is a very small point. Also, ensure that you consider edge cases, such as when n=1 and there are no trust relationships (your solution should return 1 in that case, which it does because indegree[1] would be 0, but n-1 is also 0). Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants