First Completely Painted Row or column
Code

# Code
```python3 []
class Solution:
    def firstCompleteIndex(self, arr: List[int], mat: List[List[int]]) -> int:
        pos = {}
        for i in range(len(mat)):
            for j in range(len(mat[0])):
                pos[mat[i][j]] = (i, j)
        row_count=[0]*len(mat)
        col_count=[0] * len(mat[0])
        for idx,num in enumerate(arr):
            if num in pos:
                r,c=pos[num]
                row_count[r]+=1
                col_count[c]+=1
                if row_count[r]==len(mat[0]) or col_count[c]==len(mat):
                    return idx

```
['Python3']