Team elimination check
Your task
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.
Examples
is_eliminated(wins: list[int], remaining_total: list[int], games: list[list[int]]) -> boolExample 1
Input
is_eliminated([2, 3, 3], [3, 1, 1], [[0, 2, 1], [2, 0, 0], [1, 0, 0]])Output
False