Optiver interview question

To solve sequence and probability questions