Google Interview Question

Q was based on 2 heaps