Verily Interview Question

Min heap type question, two pointer question