写个玩具algo

来源:互联网 发布:stata软件怎么下载 编辑:程序博客网 时间:2024/04/28 14:23

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 vector <int>. Return a

vector <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.

原创粉丝点击