Beta
Detecting Factions in Friend-Foe Networks
Loading description...
Graph Theory
Algorithms
Data Structures
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This kata currently does not explicitly rule out networks with any cycle that contains odd number of
-1
s, such asThese networks are unsolvable for obvious reasons, and existing solutions all return their own results when this happens.
Fixed
🤯Nicely made - but I am lost somewhere! Well - in short, my code "works" for the visible tests and not for the random ones - of course 😝 Given a matrix as:
If I understood the rules correctly, the
1
placed third in first row represents that the person indexed 0 and the person indexed 2 know each other in a friendly manner. Because index 0 is always LOL, index 3 should also be LOL.However - the result is Dota...
Where am I wrong??
The complete test data
The expectation ' ' My answer
Maybe you're misinterpreting the logs, IDK. The result for the first 4x4 matrix should be
['League of Legends', 'Dota 2', 'League of Legends', 'League of Legends']
(according to my solution).Very enjoyable and thurough about the tests. Very well built kata.
We want more like that! ;)
Thanks :D