Code Room
CodingHardcod-g882
Subject Max flowLevel Senior–Staff~40 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

A round-robin league has n teams. wins[i] is team i's current win count, remaining_total[i] is the number of games team i still has to play in total, and games[i][j] (a symmetric matrix, games[i][i]=0) is the number of games still to be played between teams i and j. Determine whether team 0 is mathematically eliminated: it is eliminated if there is NO way to assign winners to the remaining games such that team 0 ends with at least as many wins as every other team (ties are allowed, i.e. team 0 only needs to be co-leader). Return True if eliminated, else False. Constraints: 2 <= n <= 30; counts fit in normal ints.

Implement
is_eliminated(wins: list[int], remaining_total: list[int], games: list[list[int]]) → bool
Examples
in[[2,3,3],[3,1,1],[[0,2,1],[2,0,0],[1,0,0]]]outfalse
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.