Verily interview question

Min heap type question, two pointer question