Draft

Spies! Expose the dirty double crossers

Description:

A well-known fact; spies double-cross. Not only do they monitor persons of interest, they often monitor- and possibly double-cross- other friendly spies.

As the new director of the Central Spy Agency you are going to clean house. You want to start by getting rid of the spies who are spying on each other. You've managed to obtain dossiers for each spy summarizing their clandestine activity. Each dossier contains information about the persons (including other spies in your agency) the agent monitors.

If spy Roger Cly is spying on spy Jacques 1 & Jacques 3 and Jacques 1 is spying on Roger Cly and Jacques 3, and Jacques 3 is spying on Roger Cly & Jacques 1 then you have found a double-crossing ring of 3. All three are spying on one another.

Given a summary of all the dossiers [(x, xs)], find the largest double-crossing ring in your organization.

Ex 1:

[("Roger Cly",["Jacques 1","Jacques 3"]), ("Jacques 3",["Jacques 1","Roger Cly"]), ("Jacques 1",["Roger Cly","Jacques 3"])] ```

has a largest double crossing ring size of 

```3```

Ex 2: 
``` haskell 
[(1,[6,7]), (2,[1,3]), (3,[1,2])]```
has a largest doublecrossing ring size of ```2``` i.e.  double crossing ring of 2 & 3

Ex 3: 
```haskell 
[('a',['b']), ('b',['a'.'c']), ('c',['b'])]```
 has a largest doublecrossing ring size of ```2``` i.e.  double crossing rings of  size 2 are a & b  and b & c
<p>
Ex 4: 
If no spies are double crossing each other then the largest spyring size is ```1```.
Puzzles

Similar Kata:

Stats:

CreatedFeb 28, 2017
Warriors Trained36
Total Skips6
Total Code Submissions88
Total Times Completed1
Haskell Completions1
Total Stars4
% of votes with a positive feedback rating0% of 0
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes0
Ad
Contributors
  • brander Avatar
  • Voile Avatar
  • user8436785 Avatar
Ad