🏆
FIFA World Cup 2026
Week 23
With the 2026 Fifa World Cup starting in just over a week, you have decided to enter a fantasy football league with your friends where you are required to predict the outcome of the matches - there is a prize at stake and rather than simply going with your gut, you decide to simulate the tournament, based on each team's world rankings
You will simulate all matches from the group stages to the final
The competition has a few main stages:
- Group stage: 12 groups of 4 teams - winner and runner up of each group automatically go through to knockout
- The top 8 3rd place teams by points also qualify - if there are more than 8 teams on the same points, then those ties are sorted by goal difference (i.e. if a team has scored 8 goals and conceded 3, their goal difference is 5, but if they have scored 4 and conceded 7, their goal difference is -3), then world ranking. Technically there are also other things like number of yellow/red cards etc before world ranking is used - but we won't include data to simulate that for this challenge
- Knockout stage: from 32 teams, then 16, 8, 4, 2 and finally just 1 winner
Here is a 2D array representing the 12 groups ('A' to 'L') with 4 teams in each - for example, the first group - group A - consists of the teams Mexico, South Africa, Korea Republic and Czechia, then group B etc
Below shows the world rankings of all ranked teams as of June 2nd 2026 - the data is in JSON format (country : world ranking points) and is ordered in descending order of points (i.e. top teams at the beginning)
Next we can see data representing the matches played in the first knockout stages - the round of 32 teams. The numbers/letters represent the position and group of that team - for example, "1E" means the winner of group E, while "2A" means the runner up of group A. A question mark "?" means one of the 8 3rd place teams (how to determine which team that will be is explained below). The data is in pairs - i.e. indexes 0 and 1 play against each other in match 1, indexes 2 and 3 play in match 2, indexes 4 and 5 play in match 3 etc. Suppose Germany won group E, then they would be the "1E" team and playing against "?" - i.e. one of the 3rd place group stage teams
Below is JSON data mapping the 3rd place qualifiers, with the team they will play against - the data is obtained from Wikipedia here. The key represents the 8 teams that qualified - i.e. in the first row, we see the key "EFGHIJKL" - that means that the top 8 3rd place teams were from those 8 groups - i.e. E, F, G, H, I, J, K, and L. The array contains 8 columns, representing who the winners of groups A, B, D, E, G, I, K, L will play against - A is index 0, B is index 1 and so on. For example, looking at the first row, we see the array ["E","J","I","F","H","G","L","K"], that means that the winner of group A will play the 3rd place of group E, the winner of group B will play 3rd place in group J, the winner of group D will play 3rd place in group I etc. If this is confusing, the Wiki link at the beginning of this paragraph shows the full table of possibilities too
In terms of your program output, suppose we instead we simulated a hypothetical identical competition format, but using data for the top clubs in Europe according to UEFA rankings - here are the groups:
...and team rankings of:
Note that since the UEFA point scores are much lower/yet have a greater relative standard deviation, then a team ranking difference of less than 20 points is assumed to be a draw, a difference of 20 <= x < 40 was assumed to be a win by 1 goal, a difference of 40 <= x < 80 was assumed to be a win by 2 goals and anything greater is considered a win by 3 goals
Then the format would be as follows - note what is required:
- Group match outcomes and tables displayed - the table data/order is position, team name, points, goal difference - e.g. Roma were 1st in their group achieving 7 points and having a goal difference of positive 2
- All third-place teams orders and output in same format as the group table and split by those who qualified/were eliminated
- Knockout round headings and simulated games - the numbers like "1.", "2." mean the game number - i.e. game 1 consists of teams at indexes 0 and 1 in the knockout bracket, game 2 consists of teams at indexes 2 and 3 etc
Also note some important features formatting/grammar:
- Correct plurality should be used - i.e. "1 goal" compared with "2 goals"
- The winning team should always be displayed first - i.e. "Y beat X by 2 goals" and NOT "X lost to Y by 2 goals" - this consistent format makes it easier to mark
- The group matches can be output in any order - i.e. imagine teams 1, 2, 3 and 4 in Group A - you could output the game between 1 and 4 first, or the game between 2 and 3, or any other order you please
For your program, you should use the real world cup data provided - the data should be in an identical format to this example above, otherwise the answer won't be marked correct
Hints
Hints will be released at the start of each of the following days - e.g. the start of day 3 is 48 hours after the challenge starts
| Release Day | Hint |
|---|---|
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 |