AKUNA CAPITAL Interview Question

coding problem was one about heaps