WorkWave Interview Question

Solve a rather basic programming problem, pseudocode was fine.