OpenBet interview question

Solve numeric problem and fill in code to make it running