class Solution:
def findPeakGrid(self, mat: List[List[int]]) -> List[int]:
l, r = 0, len(mat) - 1
while l < r:
mid = (l + r) // 2
mx = max(mat[mid])
if mx >= mat[mid + 1][mat[mid].index(mx)]:
r = mid
else:
l = mid + 1
return [l, mat[l].index(max(mat[l]))]