[python3] Gaussian elimination
\ndef gaussianElimination(m):\n    r, c = len(m), len(m[0])\n    for i in range(r):\n        # if m[i][i] is 0, find j that m[j][i] != 0 and exchange rows i and
```\ndef gaussianElimination(m):\n    r, c = len(m), len(m[0])\n    for i in range(r):\n        # if m[i][i] is 0, find j that m[j][i] != 0 and exchange rows i and j.\n        for j in range(i, r):\n            if m[j][i] != 0:\n                m[i], m[j] = m[j], m[i]\n                break\n        # no solution.\n        if m[i][i] == 0:\n            return []\n        # do row reduction for every row, so we don\'t need back substitution.\n        for j in range(r):\n            if j == i: continue\n            diff = - m[j][i] / m[i][i]\n            for k in range(c):\n                m[j][k] += diff * m[i][k]\n    return [m[i][-1] / m[i][i] for i in range(r)]\n\ndef normalize(res):\n    r = [int(x) for x in res if x >= 0 and abs(x - int(x)) < 0.000001]\n    if len(r) != len(res):\n        return []\n    return r\n\nclass Solution:\n    def numOfBurgers(self, t: int, c: int) -> List[int]:\n        res = gaussianElimination([[4, 2, t], [1, 1, c]])\n        return normalize(res)\n```
['Matrix']