AKUNA CAPITAL interview question

Using python to solve