Daily Coding Challenge - 2026 Winter Games Day 11: Ice Hockey

for this daily challange, I’m suspecting that the test cases are buggy, specifically the first one is wrong, if anyone else is facing this problem or solved it without cheating the tests, please leave a comment :slight_smile:

Your code so far

def get_semifinal_matchups(teams):
    scores = []
    for team in teams:
        name, record = team.split(":")
        points = record.split("-")
        scores.append((name,int(points[0]) * 3 + int(points[1]) * 2 + int(points[2]) * -1))
    scores.sort(key=lambda item: item[1], reverse=True)
    
    result = f"The semi-final games will be {scores[0][0]} vs {scores[3][0]} and {scores[1][0]} vs {scores[2][0]}."

    return result



Challenge Information:

Daily Coding Challenge - 2026 Winter Games Day 11: Ice Hockey

https://www.freecodecamp.org/learn/daily-coding-challenge/2026-02-16

Hmm, with your code result for first test case is:

The semi-final games will be CAN vs SWE and FIN vs USA.

But that doesn’t seem to be right, per results, FIN should have more points than CAN:

CAN: 2-2-0-1
FIN: 2-2-1-0
GER: 1-0-1-3
SUI: 0-1-3-1
SWE: 1-1-2-1
USA: 2-1-0-2

They have one more overtime losses, rather than non-overtime loss, which is worth 1 point more.

1 Like

You’re right, i misread the problem statement, overtime losses are worth (+1) and not (-1) as i wrongfully thought.

# Before
int(points[2]) * -1)
# After fix
int(points[2]) * 1)

thanks for the help. (͡ ° ͜ʖ ͡ °)