WorkWave interview question

Solve a rather basic programming problem, pseudocode was fine.