The two of the oldest man need cheers

At a company dinner, the drinking rule was that two colleagues of similar age clinked glasses of wine.

Each meal was attended by a different number of people, who listed their ages in an irregular order. Finally, the two oldest people clinked glasses and drink for the first time.

Write a function that takes an array of the ages of the people at the table, returns the ages of the two people who clinked their glasses for the first time, and returns it in order of smallest to largest.

example:
[1,5,87,45,8,8] -> [45,87]
[6,5,83,5,3,18] -> [18,83]

have fun~

posted @ 2019-08-14 22:35  ukyo--君君小时候  阅读(163)  评论(0编辑  收藏  举报