Python Solution
\nclass Solution(object):\n    def maxCompatibilitySum(self, students, mentors):\n        """\n        :type students: List[List[int]]\n        :type mentors: L
```\nclass Solution(object):\n    def maxCompatibilitySum(self, students, mentors):\n        """\n        :type students: List[List[int]]\n        :type mentors: List[List[int]]\n        :rtype: int\n        """\n        m = len(students)\n        n = len(students[0])\n        scores =[ [sum([students[i][k] == mentors[j][k] for k in range(n)]) for i in range(m)]  for j in range(m)]\n        \n        \n        #print(scores)\n        def get_maximum_scores(mat):\n            if len(mat) == 1:\n                return mat[0][0]\n            else:\n                lst = [mat[0][j]+ get_maximum_scores( [mat[k1][:j] + mat[k1][j+1:] for k1 in range(1, len(mat)) ]) for j in range(len(mat))]\n                return max(lst)\n            \n        return get_maximum_scores(mat = scores)\n```
[]