Easy Brute Force Accepted
```\nclass Solution {\npublic:\n    int count(int i,int j,vector>&s,vector>&m){\n        int ct=0;\n        for(int k=0;k<s[i].size();k++){\n            if(s[i]
```\nclass Solution {\npublic:\n    int count(int i,int j,vector<vector<int>>&s,vector<vector<int>>&m){\n        int ct=0;\n        for(int k=0;k<s[i].size();k++){\n            if(s[i][k]==m[j][k])ct++;\n        }\n        \n        return ct;\n    }\n    \n    int func(int i,vector<int>&vis,vector<vector<int>>&st,vector<vector<int>>&men){\n        if(i==st.size())return 0;\n        \n        int ans=0;\n        for(int j=0;j<vis.size();j++){\n            int comp=0;\n            if(!vis[j]){\n                vis[j]=1;\n                comp=count(i,j,st,men)+func(i+1,vis,st,men);\n                \n                vis[j]=0;\n            }\n            ans=max(ans,comp);\n        }\n        \n        return ans;\n    }\n    \n    \n    int maxCompatibilitySum(vector<vector<int>>& students, vector<vector<int>>& mentors) {\n        \n        int n=students.size(),m=students[0].size();\n        vector<int>vis(n);\n        \n        return func(0,vis,students,mentors);\n    }\n};
['Recursion', 'C++']