AKUNA CAPITAL Interview Question

I dont quite remember, but leetcode hard