Challenge: Convert Max Heap to Min Heap

Try to solve the Convert Max Heap to Min Heap problem.

We'll cover the following

Statement

Given an array representing a max heap, convert this into a min heap.

Constraints:

  • 00\leq maxheap.length 102\leq 10^2

  • 104-10^4\leq maxheap[i] 104\leq10^4

Examples

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.