Python 2 lines brute force with permutations
python\nn = len(students)\nsums = []\nfor s in students:\n\ttemp = []\n\tfor m in mentors:\n\t\ttemp.append(sum([s[i] == m[i] for i in range(len(s))]))\n\tsums.
```python\nn = len(students)\nsums = []\nfor s in students:\n\ttemp = []\n\tfor m in mentors:\n\t\ttemp.append(sum([s[i] == m[i] for i in range(len(s))]))\n\tsums.append(temp)\nperm = list(permutations(range(0, n)))\nresult = 0\nfor p in perm:\n\tresult = max(result, sum([sums[i][p[i]] for i in range(n)]))\nreturn result\n```\n\n2 lines version:\n```python\nsums = [[sum([s[i] == m[i] for i in range(len(s))]) for m in mentors] for s in students]\nreturn max(sum([sums[i][x[i]] for i in range(len(students))]) for x in list(permutations(range(0, len(students)))))\n```\n
[]