[Community Puzzle] Spy the Spies

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

The output for testcase “04. Extra Steps” is supposed to be:

italian
NOT green-eyed
tattooed

However, the list of spies is Albert Elenora Alton Alethea Campion Evangeline, and Albert and Elenora are not italian:

Albert 2 tall tattooed
Elenora 2 tattooed french

Is this a mistake? Or have I completely misunderstood the problem?

The statement mentions:

Note that a command only gives information about spies who are associated with the given attribute, and doesn’t imply any information about those not associated with the given attribute.

“italian” not being an attribute of Albert and Elenora tells us nothing about whether they are “italian” or not, so a command of “italian” doesn’t absolve or indicate Albert or Elenora.

Going through Example 1 in the statement should help you understand more.

1 Like

Fun challenge! Not sure it’s quite deserving of being in the Very Hard category - I’d say it’s probably just regular Hard in terms of difficulty and being well doable with a breadth-first search without much in terms of optimization.

One thing that got me a bit stumped at the beginning was that it’s not directly spelled out what will the fate of people who never got neither indicted nor absolved be: apparently, they’ll be considered spies unless you already explicitly called out all spies, in which case remaining suspects will be considered innocent.