Topic: Greedy Algorithm Problem / Level: intermediate

Problem: You are given an array of integers. Rearrange the array so that no two adjacent elements are equal and the array is lexicographically smallest.

Run the code to see the output here...