Hablu Is in Quarantine

The soldiers are being trained to fight against the Coronavirus. Mr. Hablu will shake hands with som…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

I am trying to solve this in python. I get “Accepted” in sample 1 and 2 but “Wrong Answer” on the other.
I need a little hint on what is wrong. Thank you in advance. Here is my code:

Steps:

Take all data in the dictionary along with their id to identify them later
Then take only id of the soldier he will handshake, then if a soldier has ‘c’ in the list, it will print No
Otherwise yes.
To find the people who got infected, find the index of the first person.
#Then identify and put the people who will get infected
id_counter = 1 # Counter for the dictionary

I have two questions:

  1. Will all positive integers (e.g. ID) be distinct (different)?
  2. If Mr. Hablu gets affected and then he shakes hands with another corona affected soldier, then should I also print this soldier’s ID?