C++ Easy Brute Force || Using XOR property
\nint maxCompatibilitySum(vector<vector<int>>& students, vector<vector<int>>& mentors) {\n        int n = students.size(), m = students[0].size();\n        // n
```\nint maxCompatibilitySum(vector<vector<int>>& students, vector<vector<int>>& mentors) {\n        int n = students.size(), m = students[0].size();\n        // n = number of students, m = number of questions\n        vector<int> st(n), men(n);\n        for(int i = 0; i < n; ++i) {\n            int num1 = 0, num2 = 0;\n            for(int j = 0; j < m; ++j) {\n                if(students[i][j]) num1 += (1 << (m - 1 - j));\n                if(mentors[i][j]) num2 += (1 << (m - 1 - j));\n            }\n            st[i] = num1; men[i] = num2;\n        }\n        vector<int> perm(n);\n        int ans = 0;\n        iota(perm.begin(), perm.end(), 0);\n        do {\n            int cur_score = 0;\n            for(int i = 0; i < n; ++i) {\n               int cur = st[i] ^ men[perm[i]];\n                cur_score += m - __builtin_popcount(cur);\n               \n            }\n            ans = max(ans, cur_score);\n        }\n        while(next_permutation(perm.begin(), perm.end()));\n        return ans;\n    }\n\t```
[]