Skip to Main Content Skip to Search
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com
 
Latest News Jul 24 4:44PM EST 

The winners page is now online. Find out more about our winners and read their contest stories! We've also posted some statistics and commentary about the evolution of the contest and an analysis of some of the code

Per Rutquist is our overall MATLAB Golf Champion. He came away with two first place finishes and two second place finishes. We'll send him a MATLAB Jacket.

Congratulations to all of our first-place finishers: Guy Shechter, Imre Polik, Stijn Helsen, Per Rutquist, Claus Still, François Glineur, and Nicke. You will each receive a MATLAB toolkit.

You can now download the full testsuites used in the contest from the File Exchange.

If you'd like to hear about the next contest, sign up for our Contest Announcement mailing list. To subscribe send e-mail to lists@mathworks.com with subscribe contest-announce in the body.

All holes: frequencies, palindrome, encryption, infection, heaviest, pathfinder, and snake.

Infection

A 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

Place Submitted Entry Author Length
1 11:22:34 FSec4 Claus Still 60
2 10:48:56 take this Niilo Sirola 61
3 10:37:52 Porps2 Porpeta 62
4 10:36:07 Kinda short 3 Mark Bartsch 63
5 10:33:51 Kinda short 2 Mark Bartsch 66
6 10:32:25 Kinda short Mark Bartsch 69
7 10:29:53 Try 2 Imre Polik 86
8 10:28:39 chris try 1 Christopher Cheng 87
9 10:26:00 takeANY Alex Vorwerk 89
10 10:24:47 try4 wak 107
11 10:23:26 fourth Laszlo Sragner 111
12 10:22:53 ? Jeff Foster 112
13 10:20:06 Fierce/Hairy_again GreatRumpuscat 113


 golf_1_infection
 
Home

Rules

This hole (closed)

     The challenge

     Show all entries

     Search for an entry

Message board

Hall of fame

Send us feedback