← 返回 uber 的题目列表Tennis Tournament Winners
类型:online_judge
Given a list representing players' tennis ranks, print the winners for each round. Higher rank always wins.
Input
An integer array representing players' ranks. Lower integer denotes higher rank.
Output
List of winners for each round, until a single grand winner remains.
Example
Input: [1, 2, 3, 4, 5, 6, 7, 8]
Output: 1, 2, 3, 4, 5, 6, 7, 8 -> 1, 3, 5, 7 -> 1, 5 -> 1
Please implement a solution.
Example
Input
1 2 3 4 5 6 7 8