Skip to content

Commit a346d3a

Browse files
committed
Runtime: 189 ms (Top 59.67%) | Memory: 10 MB (Top 51.80%)
1 parent e8015ed commit a346d3a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/algorithms/M/Maximum Compatibility Score Sum/Maximum Compatibility Score Sum.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 189 ms (Top 59.67%) | Memory: 10 MB (Top 51.80%)
12
class Solution {
23
// Calculating compatibility scores of ith student and jth mentor
34
int cal(int i,int j,vector<vector<int>>& arr1,vector<vector<int>>& arr2){
@@ -9,7 +10,7 @@ class Solution {
910
}
1011
return cnt;
1112
}
12-
13+
1314
int helper(int i,int m,vector<vector<int>>& arr1,vector<vector<int>>& arr2,vector<bool>& vis){
1415
if(i==m){
1516
return 0;
@@ -24,11 +25,11 @@ class Solution {
2425
}
2526
return ans;
2627
}
27-
28+
2829
public:
2930
int maxCompatibilitySum(vector<vector<int>>& students, vector<vector<int>>& mentors) {
3031
int m = students.size();
3132
vector<bool> vis(m,0); // To keep track of which mentor is already paired up
3233
return helper(0,m,students,mentors,vis);
3334
}
34-
};
35+
};

0 commit comments

Comments
 (0)