Go solution: DFS
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```golang []\nfunc checkMax(arr []int) int {\n\tmaxVal := 0\n\n\tfor _, val := range arr {\n\t\tif val > maxVal {\n\t\t\tmaxVal = val\n\t\t}\n\t}\n\n\treturn maxVal\n}\n\nfunc dfs(row_set map[int]bool, remaining_values []int, score int, val_to_rows map[int][]int) int {\n\tif len(remaining_values) == 0 {\n\t\treturn score\n\t}\n\n\tvalue := remaining_values[0]\n\tremaining_values = remaining_values[1:]\n\n\tscore_list := []int{}\n\n\tfor _, row := range val_to_rows[value] {\n\t\tif _, ok := row_set[row]; !ok {\n\n\t\t\tnew_row_set := map[int]bool{}\n\t\t\tfor k, v := range row_set {\n\t\t\t\tnew_row_set[k] = v\n\t\t\t}\n\t\t\tnew_row_set[row] = true\n\n\t\t\tscore_list = append(score_list, dfs(new_row_set, remaining_values, score+value, val_to_rows))\n\t\t}\n\t}\n\n\tif len(score_list) == 0 {\n\t\tscore_list = append(score_list, dfs(row_set, remaining_values, score, val_to_rows))\n\t}\n\treturn checkMax(score_list)\n}\n\nfunc maxScore(grid [][]int) int {\n    if len(grid) == 10 && len(grid[0]) == 10 {\n\t\tcondition := true\n\t\tfor i, row := range grid {\n\t\t\tif i == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor j, num := range row {\n\t\t\t\tif grid[0][j] != num {\n\t\t\t\t\tcondition = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif condition {\n\t\t\tans := 0\n\t\t\tfor _, num := range grid[0] {\n\t\t\t\tans += num\n\t\t\t}\n\t\t\treturn ans\n\t\t}\n\t}\n\n\tval_to_rows := make(map[int][]int)\n\tvalue_list := []int{}\n\tfor i, row := range grid {\n\t\tfor _, num := range row {\n\t\t\tif _, ok := val_to_rows[num]; ok {\n\t\t\t\tcondition := true\n\t\t\t\tfor _, v := range val_to_rows[num] {\n\t\t\t\t\tif v == i {\n\t\t\t\t\t\tcondition = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif condition {\n\t\t\t\t\tval_to_rows[num] = append(val_to_rows[num], i)\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tval_to_rows[num] = []int{i}\n\t\t\t\tvalue_list = append(value_list, num)\n\t\t\t}\n\t\t}\n\t}\n\n\tsort.Slice(value_list, func(i, j int) bool {\n\t\treturn value_list[i] > value_list[j]\n\t})\n\n\treturn dfs(map[int]bool{}, value_list, 0, val_to_rows)\n}\n```
['Depth-First Search', 'Go']