Topic: Array Problem / Level: intermediate

Problem: Rearrange an array such that no two adjacent elements are the same using a priority queue (heap).

Run the code to see the output here...