InfectionA computer virus makes its way through the firewall and infects the computer of exactly one person at a company. The next hour, the virus spreads to all the people who share at least one letter in their names (no names have spaces) with the infected person. Every hour the virus spreads in a similar way, infecting people who have common letters with those already infected. After three hours, which employees will be infected? The virus is case-insensitive. Given a list of people employed in a company a = {'Anne', 'Bob', 'Alan', 'Michael', 'Lucy', 'Gus'}
and the index to the first infected person b = 1 then Anne (who is a{1}) starts off with the virus, and she gives it to Alan and Michael after an hour. An hour later they both give the virus to Lucy, and an hour after that, she gives it to Gus. So the complete list of infected employees after three hours is c = [ 1 3 4 5 6 ] Your answer c must be sorted in numerically ascending order. If b had been 2 in the case above, the answer would have been c = [ 2 ] Bob gets the disease, but does not pass it along to anyone else, since the letters B and O do not appear in any of the other names. Leaders
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||