Matrix, how to solve? : <p>Given the matrix M x N. How to print the number of the line containing the maximum number of identical elements? </p>

<pre><code>import random
n = int(input('Введите кол-во столбцов матрицы: '))
m = int(input('Введите кол-во строк матрицы: '))
matrix = [[random.randrange(0, 10) for y in range(n)] for x in range(m)]
print(matrix)
max_x = 0
for i in range(n):
    for j in range(m):
        if max_x &lt; matrix[i].count(matrix[i][j]):
            print(matrix.index(matrix[i]))
            max_x = matrix[i].count(matrix[i][j])
        else:
            break
</code></pre>
