bet365 interview question

Hinting at functional programming (recursion)