Python 3, one line
There\'s only a max of 8 students and mentors, so we can just try every permutation. Easy peasy.\n\npython\nclass Solution:\n  def maxCompatibilitySum(self, S, 
There\'s only a max of 8 students and mentors, so we can just try every permutation. Easy peasy.\n\n```python\nclass Solution:\n  def maxCompatibilitySum(self, S, M):\n    return max(sum(sum(map(eq, *z)) for z in zip(S, P)) for P in permutations(M))\n```
[]