Problem Statement | |||||||||||||
There are several people that will sit around the same table in a circular fashion. Since all these people are very self-conscious about their height, you don't want to sit any short person next to a tall one. To formalize this, we want to minimize the maximum height difference between 2 adjacent persons. You will be given the heights of the people as a int[]. Return a int[] with the height of each individual in clockwise order of a seating arrangement that follows the above rule. If there are several solutions, return the lexicographically first one. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | heights will contain between 3 and 50 elements, inclusive. | ||||||||||||
- | Each element of heights will be between 1 and 1000, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|