AKUNA CAPITAL interview question

It was around a leetcode medium-hard