Jane Street interview question

Optimization question - dice game (2 dices)