AKUNA CAPITAL interview question

Dynamic programming.