(teams: List[Team])
| 155 | |
| 156 | |
| 157 | def generate_bracket(teams: List[Team]) -> List[Team]: |
| 158 | n = len(teams) |
| 159 | |
| 160 | # get the bracket by index |
| 161 | full_bracket = bracket(n) |
| 162 | |
| 163 | # put the teams in the correct position in the bracket |
| 164 | sortedTeams = [] |
| 165 | for i in range(n): |
| 166 | sortedTeams.append(teams[full_bracket[i] - 1]) |
| 167 | logging.debug('The bracket for single elimination is...') |
| 168 | logging.debug(list(sortedTeams)) |
| 169 | return sortedTeams |
| 170 | |
| 171 | |
| 172 | def bracket(n: int): |
no test coverage detected