Hi LeetCode Team, I have been trying to solve https://leetcode.com/problems/maximum-compatibility-score-sum/ in Ruby, but it always TLE, during the contest the same logic in Python worked. Is the Ruby on LeetCode not using JIT?? I request LeetCode to please fix this (maybe upgrade ruby to 3.0 and use jit)...
def max_compatibility_sum(students, mentors)
final_score = 0
students.permutation do |s_perm|
score = 0
s_perm.zip(mentors) do |s, m|
score += s.zip(m).filter {|x, y| x == y}.length
end
final_score = [final_score, score].max
end
final_score
end