Swiss Re Interview Question

Can you solve the following coding problem?