Tap here to switch tabs
Problem
Submissions

Problem: Output Contest Matches

Try to solve the Output Contest Matches problem.

Statement

During a tournament, there are n teams ranked from 11 to n, where 11 is the strongest team and n is the weakest team.

The tournament matches are arranged in rounds. In each round, the strongest remaining team is paired with the weakest remaining team, the second strongest is paired with the second weakest, and so on. Every pair is formatted as (strongest,weakest).

This pairing process repeats round by round until only a single final match remains.

Given the integer n, return the tournament match structure as a string.

Constraints:

  • n =2x= 2^x where x is in the range [1,12][1, 12]

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Output Contest Matches

Try to solve the Output Contest Matches problem.

Statement

During a tournament, there are n teams ranked from 11 to n, where 11 is the strongest team and n is the weakest team.

The tournament matches are arranged in rounds. In each round, the strongest remaining team is paired with the weakest remaining team, the second strongest is paired with the second weakest, and so on. Every pair is formatted as (strongest,weakest).

This pairing process repeats round by round until only a single final match remains.

Given the integer n, return the tournament match structure as a string.

Constraints:

  • n =2x= 2^x where x is in the range [1,12][1, 12]