C++ | next_permutation
\n\tint maxCompatibilitySum(vector<vector<int>>& students, vector<vector<int>>& mentors) {\n        int maxScore = 0;\n        \n        vector<int> studentId, 
```\n\tint maxCompatibilitySum(vector<vector<int>>& students, vector<vector<int>>& mentors) {\n        int maxScore = 0;\n        \n        vector<int> studentId, mentorId;\n        for (int i = 0; i < students.size(); i++) {\n            studentId.push_back(i);\n            mentorId.push_back(i);\n        }\n        \n        int n = mentors[0].size();\n        int maxSum = 0;\n        \n        do {\n            int sum = 0;\n            for (int j = 0; j < mentorId.size(); j++) {\n                int cnt = 0;\n                for (int k = 0; k < n; k++) {\n                    if (mentors[mentorId[j]][k] == students[studentId[j]][k]) {\n                        cnt++;\n                    }\n                }\n                sum += cnt;\n            }\n            if (maxSum < sum) {\n                maxSum = sum;\n            }\n            \n        } while (next_permutation(studentId.begin(), studentId.end()));\n        \n        return maxSum;\n    }\n```
[]