Fixed BinaryHeap to solve the test case.