Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #307: Round-robin

Kenda
16 - Nebula
16 - Nebula

A solution to last week’s challenge can be found here.

 

Weekly Challenge Image 307.pngYou and your friends have decided to start your own tennis league. Your friends know you are good with data and have put you in charge of creating the schedule for the season.

 

At this point, you don’t know how many teams will be joining the league or how long the season will last. You decide to create an app that has two inputs: the number of teams participating and the number of weeks for the season. The app will then create a round robin schedule where each team will be matched up with each other team an equal number of times (unless the inputs require bye weeks).

 

The "Output Sample" shows what your output data rows will look like if you have 5 teams and 5 weeks for example.

joelmiller66
9 - Comet
Spoiler
Challenge 307 Image.png
balajilolla1
8 - Asteroid
Spoiler
Solution Attached

balajilolla1_0-1644875285032.png

 

TonyA
Alteryx Alumni (Retired)

Here's my solution.

Spoiler
The round robin pattern in the solution had Team A starting with 1 one in the first match and other matches in the week with 2, 3, 4 etc. The second week starting with team 2 and so on,  wrapping back to 1 after the max team. Team B started with the highest number team the first week in the first match and counting down for the successive matches in that week, wrapping back to the max team number after 1. Then started the second week with Max - 1 and so on. Turns out this does give a balanced number of matches for each pair of teams and the same number of games for every team assuming the number of weeks is a multiple of the number of teams. If not some of the teams might get one more game than others.

TonyA_0-1644884529991.png

 

RolandSchubert
16 - Nebula
16 - Nebula
Spoiler
237.jpg
Spoiler
237a.jpg237b.jpg

Great challenge! Used an iterative macro to create the the schedule.

Hilda
6 - Meteoroid

My Solution.

Spoiler
Hilda_0-1644915089312.png

Hilda_1-1644915330812.png

 

 

Qiu
20 - Arcturus
20 - Arcturus

Hope I get it right.

Spoiler
Challenge_307.PNG
AkimasaKajitani
17 - Castor
17 - Castor

My solution.

 

Spoiler
AkimasaKajitani_0-1644936424445.png


I was not sure how to handle the number of the season. So, I make the Round Robin schedule then I update the Weeks by considering the number of the season.

patrick_digan
17 - Castor
17 - Castor

Fun! Just another challenge that I found a way to overcomplicate...

Spoiler
I wanted to first find all the possible matchups (ie team 1 vs team 2, team 1 vs team 3 etc.) for each week (ie 1-2 and 3-4 could be week 1's matchups). Then I basically cartesian joined that for the number of weeks that are played. This is a really big dataset with all possible matchups. I then found the average number of distinct matchups and picked the first one. It took 2 iterative macros and way too many tools, but this is how my brain was able to think through it.
patrick_digan_0-1644940572201.png

 

Nelson_D
7 - Meteor

Hi All,

 

Attached is my solution.

Spoiler
Spoiler 

Nelson_D_0-1645014561437.png

 

Thanks

D Nelson