AKUNA CAPITAL Interview Question

Implement algorithm within certain time complexity