1""" for this matrix:
2[[ 8, 9, 4],
3 [10, 5, 18],
4 [ 5, 6, 6]]
5"""
6n = 5
7rows = mat4.shape[0]
8row_col_idxs = [(e//rows, e-(e//rows * rows))
9 for e in mat4.flatten().argsort()[::-1][:n]]
10""" result: [(1, 2), (1, 0), (0, 1), (0, 0), (2, 2)] """
11