Python - Simple DFS solution
\nclass Solution:\n    def maxCompatibilitySum(self, students: List[List[int]], mentors: List[List[int]]) -> int:\n        \n        n, m = len(students), len(s
```\nclass Solution:\n    def maxCompatibilitySum(self, students: List[List[int]], mentors: List[List[int]]) -> int:\n        \n        n, m = len(students), len(students[0])\n        out = []\n\t\t\n        def dfs(i, used, score):\n            \n            if i == n:\n                out.append(score)\n                return\n            \n            for mentor in range(n):\n                if str(mentor) not in used:\n                    curr = sum(a==b for a, b in zip(students[i], mentors[mentor]))\n                    dfs(i+1, used+str(mentor), score+curr)\n            \n        dfs(0, \'\', 0)\n        return max(out)\n```
['Depth-First Search', 'Python']