Go || My solution
Complexity\n- Time complexity: O(n.m) \n- Space complexity: O(n.m) \n\n# Code\n\nfunc firstCompleteIndex(arr []int, mat [][]int) int {\n\tn, m := len(mat), len(
# Complexity\n- Time complexity: $$O(n.m)$$ \n- Space complexity: $$O(n.m)$$ \n\n# Code\n```\nfunc firstCompleteIndex(arr []int, mat [][]int) int {\n\tn, m := len(mat), len(mat[0])\n\trow := make([]int, n)\n\tcol := make([]int, m)\n\thm := make(map[int][2]int)\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < m; j++ {\n\t\t\thm[mat[i][j]] = [2]int{i, j}\n\t\t}\n\t}\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tk := hm[arr[i]]\n\t\trow[k[0]]++\n\t\tif row[k[0]] == m {\n\t\t\treturn i\n\t\t}\n\n\t\tcol[k[1]]++\n\t\tif col[k[1]] == n {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn 0\n}\n```
['Go']