AKUNA CAPITAL Interview Question

Using python to solve